🦋 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:19 judd7 joined
leont Is an Int keyed hash a good idea? In theory it sounds like it could be, but I have the impression that will just be an object-hash instead of a string/primitive hash (I'm not sure how to describe this) 00:20
00:20 guifa2 joined
lizmat leont: modules.raku.org/dist/Hash::int:cpan:ELIZABETH 00:34
00:37 cooper joined 01:04 frost-lab joined, mowcat left
rjbs lizmat++ 01:06
01:10 HarmtH_ left, HarmtH joined 01:22 pecastro left
[Coke] sees he had a patch in progress on a module, makes the tests pass, gets to the "upload" bit and re-discovers that that's all changed since the last time 01:35
that's no fun, perhaps I'll figure out fez tomorrow.
01:35 dotdotdot joined
[Coke] (\_/) 01:36
> 🐇
01:40 dotdotdot left 01:46 dotdotdot joined
japhb fez++ # It pretty much Just Worked for me. 02:28
02:37 kvw_5 joined 02:39 kvw_5_ left 02:44 benkolera joined 02:46 berber44 joined 03:15 epony left 03:20 El_Che joined 03:39 muffindrake left 03:41 muffindrake joined 03:52 dotdotdot left 03:55 sxmx left 04:00 asymptotically left, asymptotically joined 04:11 aindilis left 04:15 sxmx joined 04:31 guifa2 left 04:37 dotdotdot joined 04:42 dotdotdot left 04:50 dotdotdot joined 05:23 dotdotdot left 05:27 DiffieHellman left 05:30 dotdotdot joined 05:38 kini joined 05:55 DiffieHellman joined, DiffieHellman left 05:56 DiffieHellman joined 05:59 parabolize left 06:30 londoed left 07:23 jmerelo joined 07:50 wamba joined 07:56 Sgeo left 07:58 HarmtH left 08:28 HarmtH joined, epony joined 08:29 HarmtH left 08:30 HarmtH joined 08:47 sena_kun joined 09:46 jmerelo left 10:36 silug5 joined, silug left, silug5 is now known as silug 11:07 pecastro joined 11:09 frost-lab left 12:05 Black_Ribbon left 12:38 Kaiepi joined 13:11 wingfold left 13:21 Kaiepi left 13:24 b2gills left 13:27 Kaiepi joined 13:55 b2gills joined 13:58 wamba left 14:13 moony left 14:15 Kaiepi left 14:17 moony joined 14:23 asymptotically left, asymptotically joined 14:25 kurahaupo joined 14:28 kurahaupo left, kurahaupo joined
leont Is there a way to have a resettable timer? I can make a new Promise.in(), but I don't think I can cancel the old one, right? 14:33
14:34 guifa2 joined 14:35 mowcat joined, mowcat left 14:36 mowcat joined 14:42 wamba joined 14:44 guifa2 left, wamba left, guifa2 joined 14:50 rindolf joined, wamba joined 15:07 aindilis joined 15:10 parabolize joined 15:13 mowcat left 15:24 PimDaniel joined 15:25 PimDaniel left 15:43 wamba left 15:49 wamba joined 16:15 wingfold joined, wingfold left, wingfold joined 16:20 sno joined 16:24 Sgeo joined 16:33 codesections joined
lizmat leont: perhaps $*SCHEDULER.cue is more what you want: docs.raku.org/routine/cue 16:43
it returns a cancellation object
17:19 smarton joined 17:21 domidumont joined
leont Yes, that does look like what I need 17:24
17:36 aluaces joined
[Coke] so, I originally used p6c, then CPAN - is fez the preferred method now? Should I migrate off CPAN? 17:50
lizmat afaik, fez is still sorta in beta ? 18:03
18:11 rindolf left 18:16 edk_ joined 18:17 edk_ is now known as e
smarton Just found out Raku has arbitrary-long integers by default, that's cool 18:18
We do live in 2021 after all
codesections here's an interesting error message that gives the impression that Rakudo can't count all that well:
m: sub f(*@a, **%h, |c) {}; f 1, 2, 3 18:19
camelia Too few positionals passed to 'f'; expected at least 2 arguments but got only 3
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
japhb [Coke]: My experience with fez has been pretty positive. I found a bug, it was fixed lickety-split. 18:20
And otherwise it's now just part of my release script. 18:21
18:39 domidumont left 18:46 spacekookie joined 18:54 spacekookie left 18:55 spacekookie joined 19:02 asymptotically left 19:03 asymptotically joined 19:05 b2gills left 19:20 kurahaupo left 19:21 kurahaupo joined, berber44 left 20:09 epony left
codesections question: why does this die 20:15
m: sub f(Int $a?, *@s) {}; f('foo') 20:16
camelia 5===SORRY!5=== Error while compiling <tmp>
Calling f(Str) will never work with declared signature (Int $a?, *@s)
at <tmp>:1
------> 3sub f(Int $a?, *@s) {}; 7⏏5f('foo')
codesections It sure _seems_ like not passing an optional argument ought to be fine...
20:29 sena_kun left
guifa2 m: sub f(Int $a?, Str $b?) {}; f('foo') 20:43
camelia 5===SORRY!5=== Error while compiling <tmp>
Calling f(Str) will never work with declared signature (Int $a?, Str $b?)
at <tmp>:1
------> 3sub f(Int $a?, Str $b?) {}; 7⏏5f('foo')
guifa2 codesections: ^^ It's probably working off of the principal that each optional argument should come in order.
I had worked on a trait a while ago that would try to reorder optional arguments based on their type, but I never finished it because I just went with named arguments ha 20:44
codesections guifa2: do you think it's a _good_ principle for it to work off of? or a buggy one?
I mean, it's not a big deal to make it a multi 20:45
guifa2 codesections: I don't think either mechanism is better than the other — but it's probably much easier to explain that optional arguments can only "match" if the previous optional is fulfilled 20:46
I mean, imagine that we allow one to be skipped
sub f(Int $a?, Int $b?, *@s) {} 20:47
now if I pass in a single Int and a Str, what decides whether it goes in A or B? Logically, we go left to right, and we don't skip.
or perhaps for more confusion, what if I do sub f(Int $a?, Int() $b?, *@s) {}; f(5, '100') 20:48
codesections hmmmm, yeah, that's a good point
maybe it's an opportunity to throw an error or warning, though. If I understand correctly, in sub f(Int $a?, *@a), the ? is totally meaningless 20:50
as in, nothing would match that signature that wouldn't match without the ? 20:51
I guess the same is true of sub f($a?, *@s) too, actually 20:53
guifa2 I'd expect it to match a blank call 20:54
m: sub f(Int $a?, *@s) { say "hi" }; f() 20:55
camelia hi
guifa2 maybe I should go back to my auto-rearranging trait 20:56
codesections oh, hmmm, interesting.
guifa2 I think where I got thrown off was not being able to fully introspect some of the attributes, or maybe it was handling multis, I forget which made me kind of give up. But it should be possible
codesections yeah. Though it'll get even easier with AST macros 20:57
guifa2 another reason for me to put stuff off ;-)
codesections s/AST/RakuAST/
21:03 smarton left 21:10 smarton joined, smarton left, smarton joined 21:16 smarton left 21:35 epony joined
brown121407 I see the Raku mailing lists are still called perl6-*. Are there plans to change them? 21:42
codesections interesting: 21:43
m: my $cap = \:key<val>:another<val2>; say $cap.list; say $cap.hash
camelia (key => val)
Map.new((another => val2))
codesections m: my $cap = \(:key<val>:another<val2>); say $cap.list; say $cap.hash
camelia ()
Map.new((another => val2, key => val))
codesections brown121407: yep. We're working on the logistics still, but it's something we'd like to do 21:44
brown121407 Also, maybe toolchain updates (like rakudo) should be announced on perl6/raku-announce so package maintainers get notifications. If they are announced in another place, please tell me. I see that perl6-announce is quite empty. 21:45
codesections: good to know, thanks!
Hmm, I see rakudo is announced on perl6-compiler 21:46
21:50 mowcat joined 23:01 wamba left
guifa2 codesections: interesting, so \:foo<bar> forces a named parameter as a positional? 23:08
m: sub foo($a, $b) { say $b }; foo \:a<1>, \:b<2> 23:09
camelia \(:b(IntStr.new(2, "2")))
guifa2 aha!
it does!
codesections Oh, that's nifty. And significantly more elegant than <b> => '2' 23:11
MasterDuke well, it's a Capture of a named param
guifa2 MasterDuke: ah actually you're right. I missed the backslash in front of the parentheses in the output 23:12
codesections oh, I missed that, too 23:15
m: sub foo($a, $b) { say $b }; foo |\:a<1>, |\:b<2> 23:16
camelia b => 2
codesections ^^^^^ works, but I'm not sure quite where it falls on the elegance spectrum 23:17
(A run where 5 of 7 characters are non-alphabetic gets a bit close to line noise, even for my tastes!) 23:18
23:51 Black_Ribbon joined
lizmat m: sub foo($a, $b) { dd $a, $b }; foo (:2a), (:3b) # my preference 23:55
camelia :a(2)
lizmat afk again& 23:56
short night :-)