šŸ¦‹ Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 6 September 2022.
00:05 sena_kun left 00:48 MasterDuke joined 01:01 jpn left 01:10 Xliff joined
Xliff How can I get the magnitude of a Complex? 01:10
Oh! That's spelled .abs! LOL 01:11
01:27 Manifest0 left
SmokeMachine I was thinking if something like this would make sense: logic Beers { has Str $.drinker; has Str $.bar; has Str $.beer; has Rat $.price; relation frequents(:$drinker, :$bar); relation likes(:$drinker, :$beer); relation sells(:$bar, :$beer, :$price); logic-rule happy(Str $drinker) { $.frequents(:$drinker, :$!bar) && $.likes(:$drinker, :$!beer) && $.sells(:$!bar, :$!beer, :$drinker) } }; my Beers $b .= new; $b.facts: { .frequents: 01:36
:drinker<SomeOne>, :bar<bar1>; .likes: :drinker<SomeOne>, :beer<beerBrand>; ā€¦ }; say $b.happy; # guifa
(Example gotten from: infolab.stanford.edu/~ullman/fcdb/a.../dlog.pdf) 01:37
01:51 sftp left 01:54 ky left, ky joined 02:12 hulk joined 02:14 kylese left 02:56 bdju left 02:58 bdju joined 03:15 hulk left, kylese joined 03:30 kylese left 03:34 kylese joined 03:55 CIAvash joined 04:13 Voldenet_ joined 04:14 ponycat left, Voldenet left, Voldenet_ is now known as Voldenet 04:22 ponycat joined 05:14 Voldenet_ joined 05:15 Voldenet left, Voldenet_ is now known as Voldenet 05:33 Xliff left 06:48 Sgeo left 09:10 jpn joined 09:36 jpn left 09:37 CIAvash left 09:45 jpn joined 09:52 sena_kun joined 11:33 haxxelotto joined 11:44 jpn left 11:50 jpn joined 11:59 jpn left 12:00 jpn joined
librasteve i read this recently ā€¦ $ is for $calar, @ is for @rray, % is for key/value 12:04
12:05 jpn left
so I like Ā£ is for Ā£ogic, plus itā€™s easy to type on my keyboard :-) 12:05
12:13 Manifest0 joined
antononcube Hmm... unfortunately that sigil interpretation does not "scale": - & is for &unction, because it represents a function or subroutine - * is for *bject, as it signifies an object or reference in the code - # is for #ash, symbolizing a hash or hash table data structure - ~ is for ~tring, it represents text manipulation - ^ is for ^ower, it denotes exponentiation operations 12:20
> so I like Ā£ is for Ā£ogic, plus itā€™s easy to type on my keyboard šŸ™‚ The currency symbols do scale though šŸ™‚ : - Ā„ is for Ā„ield, representing the return value of a function - ā‚¬ is for ā‚¬xpression, denoting a mathematical or logical operation - ā‚½ is for ā‚½rocess, indicating a specific process or thread within a program - ā‚¹ is for ā‚¹esult, showing the outcome of a computation or operation - Ā¢ is 12:22
for Ā¢onstant, used for fixed values or variables that do not change
12:54 jpn joined 12:59 jpn left 14:00 jpn joined 14:05 jpn left 14:06 haxxelotto left 14:35 notna joined
notna hi @all. whom to talk to about rakudo/docker and the outdated Star docker container? would be great if someone gets in touch at github.com/Raku/docker/issues/57 14:40
tellable6 2023-01-19T21:52:33Z #raku-dev <patrickb> notna: I seem to recall, that rba once built the DMG images. (Or was it Coke?)
antononcube I would like to have readily available a few Web page importing functions and text statistics functions. For example, a sub import that imports content of web page or a file. If a 14:46
If the first argument to import is URL, then properties like <html xml plaintext> can be additionally specified. If the first argument is a file path, then the content of the file is slurped. Etc. 14:48
Does a Raku package/module with similar mission or functionalities exist? If not, what is a good name for such module? 14:49
I consider "Data::Import" -- seems generic enough.
lizmat not sure about the distribution name, but maybe it should just export "slurp" candidates ? 14:51
antononcube @lizmat Hmm... very interesting idea... 14:52
My motivation is getting inputs for LLMs faster, be those (plain-)text, images, JSON- or CSV data. Is having "slurps" for all of those be considered confusing? 14:54
*Would...
@lizmat "Data::Slurps" sounds good. šŸ™‚ 14:55
ugexe github.com/Raku/old-design-docs/bl...bleencoded 14:59
15:01 jpn joined 15:06 jpn left
antononcube @ugexe I am somewhat ignorant about full spectrum of the "IO::*" hierarchies and functionalities, so, for me, "IO::Streamable" and "IO::Readable::Encoded" are "just" role designs. 15:08
So, if I "just want concrete file or URL content at hand", function names like "import", "import-url", "import-image" are much clearer of what I would get if I use them. 15:10
15:12 notna left
I would say that utilizing and acting upon a design like "IO::Readable::Encoded" will require much more understanding and implementation effort that what I am currently inclined to do. 15:16
15:47 vlad joined 16:00 vlad_ joined 16:02 jpn joined 16:03 vlad left 16:07 jpn left 16:42 ptc joined
guifa X operator is lazy right? 16:52
antononcube It is crossy for sure. 16:53
lizmat m: ((1,2,3) X (4,5,6)).iterator.is-lazy.say
camelia False
lizmat m: ((1,2,3 ... *) X (4,5,6 ... *)).iterator.is-lazy.say 16:55
camelia True
lizmat depends on the underlying iterators
guifa ah dang
For something I'm doing I wanted to have a big giant loop
lizmat m: ((1,2,3).lazy X (4,5,6)).iterator.is-lazy.say 16:56
camelia True
lizmat add .lazy ?
guifa ah that might work
antononcube @lizmat I want to be sure what you proposed earlier -- like the following right? slurp('pypi.org/project/ChernoffFace/', 'plaintext')
guifa m: my @a = <a b c>; my @b = 1,2,3; my @c = [@a,@b]; ([X] |@c).iterator.is-lazy.say 16:57
camelia False
guifa m: my @a = <a b c>; my @b = 1,2,3; my @c = [@a,@b]; ([X] |@c).say
camelia ((a 1) (a 2) (a 3) (b 1) (b 2) (b 3) (c 1) (c 2) (c 3))
lizmat antononcub yes, but with the 'plaintext' arg as a named: slurp('pypi.org/project/ChernoffFace/', :plaintext)
antononcube Or for an image file: slurp('~/Downloads/scene.png')
guifa m: my @a = <a b c>; my @b = 1,2,3; my @c = [@a,@b]; ([X] |@c).lazy.is-lazy.say
camelia True
antononcube @lizmat I currently have it is named and positional. I think I prefer to have a more general named argument ":$prop". (That can be "plaintext" or "html" or Whatever.) 16:59
lizmat :format<plaintext>
guifa nope just tagging on .lazy doesn't work =/ 17:00
I guess [X] forcibly consumes
antononcube Yeah, :$format is better. 17:01
guifa m: my @a = lazy 0, { say "^{$_ + 1}"; $_ + 1 } ... 3; my @b = lazy 'a', { say "+{$_.succ}"; $_.succ } ... 'd'; my @c = [@a,@b]; ([X] |@c).lazy.is-lazy.say;
camelia True
guifa or wait did this get changed?
oooooh
my @a = lazy 0, { say "^{$_ + 1}"; $_ + 1 } ... 3; my @b = lazy 'a', { say "+{$_.succ}"; $_.succ } ... 'd'; my @c = [@a,@b]; ([X] |@c).say; 17:02
evalable6 (...)
guifa okay sweet. this will make my logical programming go MUCH nicer
lizmat :-) 17:03
guifa (after all,that's basically all it does)
17:03 jpn joined
guifa drills through all of the candidates and moves to the next combination as soon as something doesn't fit 17:04
antononcube So, I am deciding the create a package "Data::Slurps", but I want to keep it (relatively) lightweight. For example, I do not want its installation to depend on "Text::CSV" or "PDF::Extract", but if those packages are installed already they would be used. Is this, generally speaking, a good idea? 17:05
Maybe, users would find it misleading.
guifa I think it's fine. Just present a warning if you encounter a file you can't handle, and explain options for opening it 17:06
lizmat antononcube App::Rak has optional dependencies, and there is an App::Rak::Complete dist that will also install all of the optional dependencies
antononcube @lizmat Ok. If someone complains, I will point "App::Rak" to them. 17:07
And, yes, "Data::Slurps::Complete" is a very good idea! 17:08
17:08 jpn left 17:59 xinming left 18:00 xinming joined 18:04 jpn joined 18:10 jpn left 18:13 jpn joined 18:14 xinming left, xinming joined 18:20 vlad__ joined, vlad__ left 18:23 vlad_ left 18:28 Sgeo joined
SmokeMachine guifa: have you seen my suggestion? 18:46
18:52 jpn left 19:13 [Coke] left 19:15 [Coke] joined 19:20 vrurg joined, vrurg_ left, [Coke]_ joined 19:21 [Coke] left 19:50 jpn joined 19:55 jpn left 20:02 vrurg left 20:03 vrurg joined 20:25 jpn joined 20:44 jpn left 21:18 [Coke]_ is now known as [Coke] 22:02 jpn joined
ab5tract bisectable: (a => 1).kv.WHAT ~~ List 22:03
bisectable6 ab5tract, Will bisect the whole range automagically because no endpoints were provided, hang tight
ab5tract, Ā¦6c (77 commits): Ā«Ā»
ab5tract, Nothing to bisect!
ab5tract bisectable: (a => 1).kv.WHAT ~~ Seq 22:04
bisectable6 ab5tract, Will bisect the whole range automagically because no endpoints were provided, hang tight
ab5tract, Ā¦6c (77 commits): Ā«Ā»
ab5tract, Nothing to bisect!
ab5tract well that doesn't seem right :/
bisectable: (a => 1).kv[0] eq "a" 22:05
bisectable6 ab5tract, Will bisect the whole range automagically because no endpoints were provided, hang tight
ab5tract m: (a => 1).kv[0] eq "a"
camelia WARNINGS for <tmp>:
Useless use of "eq" in expression "[0] eq \"a\"" in sink context (line 1)
bisectable6 ab5tract, Ā¦6c (77 commits): Ā«WARNINGS for /tmp/BT41UnosFm:ā¤Useless use of "eq" in expression "[0] eq \"a\"" in sink context (line 1)ā¤Ā»
ab5tract, Nothing to bisect!
ab5tract m: my $a = a => 1; say $a.kv[0] eq "a" 22:06
camelia True
22:07 jpn left 22:14 sena_kun left 22:22 bdju left 22:29 bdju joined 22:48 [Coke]_ joined 22:49 [Coke] left 23:17 ptc left 23:30 jpn joined 23:34 jpn left