🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku
Set by ChanServ on 14 October 2019.
00:09 wingfold joined 00:17 wingfold left 00:18 pecastro left 00:23 wingfold joined 00:24 moon-child left, moon-child joined 00:28 b2gills joined
Doc_Holliwood wasn't there a shortcut to define a sub that is just a single expression? 00:36
codesections m: sub f(--> 42) {}; say f; 00:42
camelia 42
codesections like that? ^^^^
moon-child I mean, you can just do sub f { 42 }. Seems short enough to me 00:50
japhb Or if it doesn't have to be a Sub, then just { 42 }. 00:53
01:04 oneeggea_ joined 01:06 oneeggea_ left, wingfold left, oneeggea_ joined 01:07 wingfold joined, oneeggeach left 01:10 oneeggea_ left, oneeggeach joined, oneeggeach left 01:11 wingfold left 01:17 wingfold joined 01:22 Doc_Holliwood left, wingfold left 01:28 monkey__ joined 01:29 Doc_Holliwood joined 01:36 wingfold joined 01:39 Geth left 01:40 wingfold left
moon-child m: class Foo { has Int:D ($.x = 1, $.y = 2); }; print Foo.new.x; 01:44
camelia Use of uninitialized value of type Int in string context.
Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
in block <unit> at <tmp> line 1
moon-child ^^ bug?
01:46 benkolera left 01:47 wingfold joined 01:48 g0nk joined, wingfold left, wingfold joined 01:52 wingfold left
codesections pretty sure that's intentional, though surprising behavior. Defaults aren't applied until after BUILD 01:54
docs.raku.org/language/objects#Obj...nstruction
moon-child yes but 01:56
m: class Foo { has Int:D $.x = 1; }; print Foo.new.x;
camelia 1
moon-child it only happens when declaring multiple members at once
codesections oh, hmm
moon-child m: class Foo { has Int:D ($.x = 1); }; print Foo.new.x; 01:57
camelia Use of uninitialized value of type Int in string context.
Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
in block <unit> at <tmp> line 1
codesections ~m: class Foo { has (Int:D $.x = 1, $.y = 2); }; print Foo.new.x;
m: class Foo { has (Int:D $.x = 1, $.y = 2); }; print Foo.new.x;
camelia Use of uninitialized value of type Int in string context.
Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
in block <unit> at <tmp> line 1
codesections m: class Foo { has (Int:D $.x = 1, Int:D $.y = 2); }; print Foo.new.x; 01:58
camelia Use of uninitialized value of type Int in string context.
Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
in block <unit> at <tmp> line 1
codesections m: class Foo { has (Int:D() $.x = 1, Int:D $.y = 2); }; print Foo.new.x;
camelia Use of uninitialized value of type Int in string context.
Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
in block <unit> at <tmp> line 1
codesections m: class Foo { has (Int:D() $.x = 1, Int:D $.y = 2); }; dd Foo.new; 01:59
camelia Foo.new(x => Int, y => Int)
codesections well, that's odd...
02:03 neshpion joined 02:06 wingfold joined 02:09 Doc_Holliwood left 02:14 kvw_5_ joined 02:15 wingfold left 02:18 kvw_5 left 02:27 wingfold joined 02:38 neshpion left 02:44 g0nk left 03:12 wingfold left 03:14 aborazmeh left 03:21 monkey__ left 03:27 wingfold joined 03:28 kaiwulf left 03:30 aborazmeh joined 03:53 berber44 left 04:02 tejr left, tejr joined 04:11 wingfold left 04:23 wingfold joined 05:09 samcv left 05:10 wingfold left, samcv joined 05:17 parabolize left 05:22 wingfold joined 05:52 wamba joined 06:05 lucs left, lucs joined 06:08 frost-lab joined, wingfold left 06:10 samcv left 06:11 samcv joined 06:17 ex_nihilo joined 06:21 wingfold joined 06:25 Doc_Holliwood joined 06:27 xinming_ left 06:28 xinming_ joined 06:46 imcsk8 left
summerisle i need a good grammar tutorial/reference for grammars that deal with newlines 06:47
06:48 jmerelo joined 06:49 aborazmeh left 06:54 Sgeo left 06:55 xinming joined 06:57 xinming_ left 06:59 xinming_ joined 07:01 Doc_Holliwood left 07:03 xinming left 07:05 wamba left 07:09 benkolera joined, imcsk8 joined 07:12 wingfold left, Doc_Holliwood joined 07:13 wingfold joined 07:17 wingfold left 07:29 rindolf joined 07:31 wingfold joined 07:35 DiffieHellman left, DiffieHellman_ joined, DiffieHellman_ is now known as DiffieHellman 07:52 domidumont joined 07:56 domidumont left 07:59 abraxxa joined 08:05 pecastro joined 08:10 abraxxa left, domidumont joined, abraxxa joined
SmokeMachine japhb: Hi! sorry for not answering, but yes, that was a place to talk about Red! 08:16
08:18 patrickz joined 08:21 wingfold_ joined, wingfold left 08:22 wingfold joined, wingfold_ left 08:24 wamba joined 08:26 wingfold_ joined, wingfold left 08:28 wingfold joined, wingfold_ left 08:33 wingfold left 08:34 Kaiepi left 08:35 dakkar joined 08:46 wingfold joined 08:48 squashable6 left 08:50 wingfold left 08:51 squashable6 joined 09:01 sena_kun left, sena_kun joined 09:02 wingfold joined 09:11 wingfold left 09:14 notagoodidea joined, patrickz left 09:15 patrickb joined
notagoodidea So after talking with Ben Hoyt, Raku would not been included in the `countdown` comparison due to being to slow :'( github.com/benhoyt/countwords/pull/74 09:15
From profiling the "optimized" version, my findings tends to be : 09:18
(1) Using the default trait on the Hash and `==` comparaison with .AT-KEY method seems faster than .EXISTS-KEY 09:19
(2) Calling .AT-KEY was the most costly call based on the profiler 09:20
09:25 wingfold joined
notagoodidea (3) pull-one method seems to a bit costly too. In the first `for` loop, the IO::Handle version is at 99% inlined. Most suprising, is that the for $_.lc.words loops call the pull-one method from Str (and it is not inlined). 09:27
But words output a Seq? 09:28
Okay, no it is words that call pull-one on the string passing by .lc. 09:31
09:45 frost-lab left
notagoodidea And (1) need to be more tested -_- 09:54
09:56 Kaiepi joined 10:01 notagoodidea left 10:03 notagoodidea joined 10:04 wamba left 10:05 MasterDuke left 10:11 notagoodidea left 10:13 notagoodidea joined 10:14 wingfold left 10:18 nebuchadnezzar left, nebuchadnezzar joined 10:19 wingfold joined 10:20 wamba joined, wingfold left, wingfold joined 10:21 wingfold_ joined, wingfold left 10:29 sno joined 10:30 frost-lab joined 10:33 sno left 10:39 lozenge_ joined 11:03 patrickb left 11:06 wingfold_ left, wingfold joined 11:26 ab5tract joined 11:28 vike left
ab5tract wrote a small blog post of appreciation fro rakudo-pkg : 5ab5traction5.bearblog.dev/overdue...akudo-pkg/ 11:33
11:34 Doc_Holliwood left, vike joined 11:42 Doc_Holliwood joined 11:47 dogbert11 left 12:03 frost-lab left 12:06 dogbert11 joined 12:11 aluaces left 12:17 ab5tract left 12:24 ab5tract joined 12:33 Kaiepi left 12:38 monkey__ joined 12:41 aluaces joined 12:43 Kaiepi joined 12:48 Black_Ribbon left 12:56 Doc_Holliwood left 13:01 telex left, telex joined 13:02 lozenge_ left 13:03 wamba left 13:15 monkey__ left 13:31 astik_ left 13:32 wamba joined 13:37 ens_ joined 13:56 ab5tract left 14:10 synthmeat left 14:13 Sgeo joined 14:15 jmerelo left 14:25 sena_kun left 14:26 sena_kun joined 14:28 synthmeat joined 14:34 daemon is now known as Alchjemy, Alchjemy is now known as Alchemy 14:44 MasterDuke joined, daxim joined 14:47 synthmeat left 14:49 wingfold left 14:50 wingfold joined, hobbs left, hobbs joined, hobbs left, hobbs joined 14:52 parabolize joined 14:54 wingfold left 14:59 wingfold joined 15:06 synthmeat joined 15:09 aborazmeh joined 15:13 wamba left 15:20 brtastic joined 15:28 abraxxa left 15:29 abraxxa joined 15:30 guifa2 joined 15:36 ex_nihilo left 15:42 Kaiepi left 15:43 synthmeat left 15:44 synthmeat joined 15:48 Doc_Holliwood joined 16:03 synthmeat left 16:07 aborazmeh left 16:08 aborazmeh joined 16:10 lichtkind joined 16:23 notagoodidea left, synthmeat joined 16:25 synthmeat left, synthmeat joined 16:30 Doc_Holliwood left 16:47 brtastic left
summerisle can anyone provide some insight as to why the `block` token only matches one member-mapping token for the example on L61 of this gist? gist.github.com/RomanHargrave/4f2b...0a470ecbfc 16:52
i'm also somewhat confused as to why this works with an explicit definition of newlines, but not \v 16:53
17:02 jmerelo joined
guifa2 summerisle: it's because you have member-mapping as a rule 17:15
rules expect whitespace after *each* inner token 17:16
so rule { a b c } is equal to token { a <.ws> b <.ws> c <.ws> }
17:17 patrickb joined
guifa2 It's that finally <ws> that's throwing things off, because <ws> includes (by default) vertical white space. So it consumes the new line and all of the space on the next line. Then it tries to handle <eol> which requires a linebreak, which no longer exists 17:18
final*
17:31 dakkar left
jmerelo geth no longer works, right? 17:34
.seen Geth
tellable6 jmerelo, I saw Geth 2021-03-17T19:34:05Z in #raku-dev: <Geth> ¦ rakudo/fix_continuation_race_condition_in_tps: ␂review: github.com/rakudo/rakudo/commit/2eb249cae8
jmerelo Well, it does not work on Raku/doc, apparently...
17:48 guifa2 left 17:50 orinthe left 17:53 wamba joined 17:55 orinthe joined 17:58 patrickb left 18:16 domidumont left 18:41 kaiwulf joined 18:57 jmerelo left 18:59 MasterDuke left 19:01 mowcat joined 19:07 mowcat left 19:31 Kaiepi joined 19:33 wingfold left 19:34 wingfold joined 19:35 imcsk8 left, Doc_Holliwood joined 19:36 imcsk8 joined 19:38 wingfold left 19:47 mowcat joined 19:52 wingfold joined 20:00 wingfold left 20:05 squashable6 left 20:08 squashable6 joined, wamba left 20:09 wamba joined 20:13 wingfold joined 20:17 wingfold left 20:31 wingfold joined 20:49 abraxxa left
summerisle .tell guifa2 that did it. no clue why that didn't occur to me. this week has been cursed. 20:53
tellable6 summerisle, I'll pass your message to guifa2
21:15 wamba left 21:16 wingfold_ joined, wingfold left 21:20 wingfold_ left, wamba joined 21:23 gordonfish left 21:27 aindilis left, aindilis joined, japhb left 21:28 japhb joined 21:29 samebchase-5 joined, samebchase- left 21:30 mowotter joined 21:32 mowcat left 21:34 wingfold joined 21:39 wingfold left 21:40 dogbert17 joined 21:43 wingfold joined 21:44 dogbert11 left 21:47 sena_kun left 21:48 wingfold_ joined, wingfold left, sena_kun joined, MasterDuke joined, wingfold_ left 21:49 wingfold joined 21:50 wingfold_ joined, wingfold left 21:51 Alchemy is now known as daemon, lichtkind left 21:52 lichtkind joined 21:53 wingfold joined, wingfold_ left 21:56 spacebat2 left, spacebat2 joined 21:58 sxmx left 21:59 sxmx joined 22:00 guifa2 joined 22:03 clarjon1 joined 22:06 abraxxa joined 22:07 dag29 joined
dag29 Hello 22:07
I've got a newbish raku coding question if/when someone would like to help. 22:11
codesections hi and welcome :)
22:14 guifa2 left 22:23 gordonfish joined 22:28 blaboeir joined
vrurg .tell tyil I have sent you request. Not sure if it was delivered, though. 22:31
tellable6 vrurg, I'll pass your message to tyil
tyil what kind of request?
summerisle another grammar question. i have a token 'package' defined as `<name>+ % '.'` and a token 'fqdn' defined as `<package> '.' <name>`. I'm expecting <package> to match everything up to the last <name> in a sequence such as 'a.b.c.d.e' such that `<package>` captures <a b c d> and `<name>` captures 'e'. 22:32
unfortunately, this will not match
i should probably go read the regex docs again
moon-child summerisle: I guess you need to make it a regex, because tokens are ratcheting 22:33
summerisle i suppose 22:34
moon-child summerisle: but easier is probably to ditch <name> and grab that later in postprocessing
summerisle i had initially intended to do this in postprocessing but I suppose that I was hoping I could take care of all decomposition in the grammar
i guess it would make the grammar more efficient if i made fewer assumptions as well 22:35
or made more, i mean to say
yep, making <package> a regex does it 22:36
22:37 dogbert11 joined 22:38 vrurg left 22:39 aluaces left, wingfold left 22:40 wingfold joined, dogbert17 left 22:41 wingfold_ joined, wingfold left
dag29 I'm trying to pull multiple lines from a file at once for $file.IO.lines -> $line1, $line2, $line3 but I don't know before hand how many lines the file has.  How can I avoid an error when it gets to the end of the file and doesn't find all 3 lines and still get however lines there are left? 22:41
22:45 wingfold_ left
moon-child for $file.IO.lines -> $line1, $line2 = Any, $line3 = Any { ... } 22:45
lizmat $file.IO.lines -> $line1, $line2?, $line3?
or what moon-child said :-)
dag29 ty, I'll try those out :) 22:46
tyil $file.IO.lines.rotor(3) -> @lines { } # should give you up to 3 lines every iteration
22:46 vrurg joined
tyil oh, .rotor() needs :partial 22:47
vrurg tyil: There is bug in Configure which makes it impossible to inherit from 22:48
tyil vrurg: ah, your mail
I saw it, but didn't have time yet to look at it
vrurg tyil: Ok, just wanted to make sure because the email address format is rather unsual. :) 22:49
*unusual
tyil it's not common, but very RFC compliant :D 22:50
if I understand the issue correctly, this patch should solve it p.tyil.nl/k3bz 22:51
and `prove6 -lv` says it doesn't break anything 22:52
vrurg tyil: Looks like it should.
22:53 dogbert17 joined 22:57 dogbert11 left
dag29 ty all for the help.  works great now :) 22:57
tyil vrurg: Uploaded Config-3.0.4.tar.gz to CPAN 22:58
vrurg: you can also install it from dist.tyil.nl/raku/modules/Config/C...0.4.tar.gz
vrurg tyil: thanks! 22:59
22:59 Xliff joined
vrurg is trying hard not to implement bind config format parser... 23:00
tyil vrurg: could be a fun project for a weekend :> 23:01
23:01 aborazmeh left
vrurg tyil: not in my vision. I want it to be extendable, free-form. So that it'd be possible to add, say, roles implementing own data formats; to pre-declare block types and their properties. 23:04
tyil would be cool to see use of roles for different data formats 23:09
right now I'm using Config::Parser::$name as a means to an end
(but note that Config is my first module, so it's probably full of things that could be done prettier in Raku)
23:11 wingfold joined
codesections wonders whether Encoding::Registry could be used to read config files 23:12
ugexe i would assume it gets used every time you read a non-binary config file 23:14
codesections well, most of those presumably use the utf_ encoders that are built in to the VM 23:15
23:16 wingfold left
codesections I was wondering about registering a custom encoder to extract data from a file before/without reading it in as a Str 23:16
23:16 pecastro left 23:17 vike left, dag29 left 23:22 vike joined
ugexe i still dont follow 23:24
why would you want to not using the e.g. utf_ / latin1 encoders from the VM?
23:25 meltingwax joined, wingfold joined 23:26 wingfold_ joined, wingfold left 23:27 g0nk joined, meltingwax left 23:28 daemon is now known as daimon
codesections I mean, it's a kind of off-the-wall idea (and I'm not _super_ serious for config file formats), but in theory if you have a structured config format, you should be able to skip processing some parts as strings, and encode them to whatever datatype you want. (E.g., the normal flow would be ConfigFile ==> Str ==> MyConfigObj, but this would let you do ConfigFile ==> MyConfigObj, which might be faster) 23:28
But reading config files is not an area where performance is super critical most of the time, and it'd make error reporting for invalid configs _much_ harder. Which is why I'm not really serious. I just think the fact that we have access to that low a level feature of the runtime pretty neat 23:30
23:31 wingfold_ left 23:32 lichtkind left 23:34 brtastic joined 23:35 aindilis` joined
moon-child m: say <1 2 3>[0 .. *-1]; say <1 2 3>[0 .. *]; say <1 2 3>[0 .. *+1] 23:35
camelia (1 2 3)
(1 2 3)
(1 2 3 Nil Nil)
23:36 wingfold joined
moon-child ^^ why isn't <1 2 3>[0 .. *] (1, 2, 3, Nil)? 23:36
codesections moon-child: that's pretty magical. In both a good and a bad way
23:37 wingfold left, wingfold joined
codesections Well, my question was, "why isn't <1 2 3>[0 .. *] <1 2>?" 23:38
23:38 rindolf left, aindilis left
moon-child not thinking of ..^ * ? 23:39
codesections (since * means "whatever default makes sense in context", I would have thought that 0..* means the whole thing. But you clearly thought it meant 'the length of the list'. And Raku makes us both right, by magic) 23:40
moon-child ah hmmm 23:41
23:42 wingfold_ joined, wingfold left, aindilis` left
moon-child I thought * was a whatevercode to which was passed the length of the list 23:42
23:46 wingfold_ left
moon-child m: print -6 .abs 23:58
camelia 6
moon-child m: print -6 .WHAT
camelia ===SORRY!===
Method call must either supply a name or have a child node that evaluates to the name
moon-child m: print (-6).WHAT
camelia Use of uninitialized value of type Int in string context.
Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
in block <unit> at <tmp> line 1
moon-child er
m: print: (-6).WHAT
camelia ( no output )