Raku Conference Day 2 on Youtube: www.youtube.com/watch?v=BL9-XdC9WYI 🦋 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 14 August 2022.
00:08 reportable6 left, reportable6 joined 00:16 guifa_ joined 00:17 guifa left 00:56 discord-raku-bot left 00:57 discord-raku-bot joined 00:58 markmarkmark left 01:58 greppable6 left, benchable6 left, linkable6 left, bisectable6 left, evalable6 left, statisfiable6 left, notable6 left, bloatable6 left, quotable6 left, nativecallable6 left, committable6 left, reportable6 left, unicodable6 left, tellable6 left, releasable6 left, shareable6 left, coverable6 left, quotable6 joined, bloatable6 joined 01:59 evalable6 joined, benchable6 joined, coverable6 joined, notable6 joined, nativecallable6 joined, unicodable6 joined, committable6 joined, reportable6 joined, bisectable6 joined 02:00 linkable6 joined, tellable6 joined, statisfiable6 joined, greppable6 joined, shareable6 joined 02:01 releasable6 joined 03:01 unicodable6 left, shareable6 left, notable6 left, committable6 left, linkable6 left, releasable6 left, greppable6 left, statisfiable6 left, quotable6 left, sourceable6 left, nativecallable6 left, benchable6 left, coverable6 left, squashable6 left, reportable6 left, bloatable6 left, evalable6 left, tellable6 left, bisectable6 left, bisectable6 joined, shareable6 joined 03:02 notable6 joined, reportable6 joined, benchable6 joined, unicodable6 joined, linkable6 joined, releasable6 joined 03:03 committable6 joined, evalable6 joined, statisfiable6 joined, nativecallable6 joined, squashable6 joined 03:04 quotable6 joined, bloatable6 joined, greppable6 joined, sourceable6 joined, tellable6 joined, coverable6 joined 03:16 bigdata joined 04:00 epony left 05:00 statisfiable6 left, linkable6 left, bisectable6 left, unicodable6 left, notable6 left, bloatable6 left, committable6 left, shareable6 left, reportable6 left, evalable6 left, greppable6 left, releasable6 left, coverable6 left, tellable6 left, squashable6 left, quotable6 left, nativecallable6 left, benchable6 left, sourceable6 left 05:01 statisfiable6 joined, releasable6 joined, bisectable6 joined, nativecallable6 joined, quotable6 joined 05:02 greppable6 joined, squashable6 joined, notable6 joined, linkable6 joined, shareable6 joined, committable6 joined, evalable6 joined 05:03 unicodable6 joined, reportable6 joined, coverable6 joined, benchable6 joined, tellable6 joined, sourceable6 joined, bloatable6 joined 06:03 committable6 left, statisfiable6 left, bloatable6 left, tellable6 left, quotable6 left, benchable6 left, sourceable6 left, coverable6 left, linkable6 left, evalable6 left, nativecallable6 left, shareable6 left, notable6 left, bisectable6 left, squashable6 left, releasable6 left, unicodable6 left, greppable6 left, reportable6 left 06:04 quotable6 joined, reportable6 joined, greppable6 joined, evalable6 joined, shareable6 joined, statisfiable6 joined 06:05 notable6 joined, unicodable6 joined, bloatable6 joined, linkable6 joined, tellable6 joined, benchable6 joined 06:06 squashable6 joined, nativecallable6 joined, sourceable6 joined, committable6 joined, releasable6 joined, coverable6 joined, bisectable6 joined 07:04 bigdata left 08:04 evalable6 left, linkable6 left, linkable6 joined 08:06 evalable6 joined 08:51 Sgeo left 09:51 nativecallable6 left, benchable6 left, linkable6 left, evalable6 left, statisfiable6 left, notable6 left, squashable6 left, releasable6 left, bisectable6 left, tellable6 left, committable6 left, greppable6 left, quotable6 left, bloatable6 left, unicodable6 left, shareable6 left, bisectable6 joined, evalable6 joined, bloatable6 joined 09:52 tellable6 joined, releasable6 joined, benchable6 joined, committable6 joined, nativecallable6 joined, shareable6 joined, notable6 joined, unicodable6 joined 09:53 greppable6 joined, statisfiable6 joined, habere-et-disper joined, quotable6 joined, linkable6 joined 09:54 squashable6 joined
habere-et-disper Can one use with with a hash? 09:54
Something like:
m:  my %bar = <a 1>; say {a} with %bar
camelia ===SORRY!=== Error while compiling <tmp>
Undeclared routine:
a used at line 1
habere-et-disper Okay I think I got it... 09:57
m: my %bar = <a 1>; say .<a> with %bar
camelia 1
Nemokosch .<a> and it should be fine
or .{'a'}
habere-et-disper Thanks discord-raku-bot !
Nemokosch 😁 09:59
habere-et-disper I am enjoying the extra allowance of whitespace in raku, but I can't get it here: 10:10
and have to use
or am I missing some more magic?
Whoops:
`/ < :Separator > /` versus `/ <:Separator> /`
Nemokosch what is the goal? 10:17
leont Having a very weird dispatch related issue. But I guess you could say I'm stress testing it given it involves multi methods, conversion types and capture arguments. 10:20
Nemokosch well, consider opening a rakudo issue if it's suspicious enough 10:21
I remember samewith didn't work with caching, for example 10:22
10:24 epony joined
lizmat tonyo: rak 0.0.14 fell into a black hole it seems, 0.0.15 (only doc changes) uploaded and now visible 10:25
tonyo: still wondering what happened to 0.0.14
Nemokosch did you not get a mail? 10:30
it may even end up in spam
lizmat no mail, checked my spam 10:36
in any case, the upload was successful and it said that it would get indexed: if there was something wrong with it, it would have said it at upload, no ? 10:37
10:39 epony left 10:44 sena_kun joined 10:50 epony joined
Nemokosch iirc I did get mails after supposedly succesful uploads 10:50
and I only noticed it later that it didn't just fail randomly
tbrowder howdy! 10:53
i'm trying to load a module with 'require' and test for sucess per the docs but not having any luck. i'm using the syntax shown in the docs: 10:55
my $m = 'Foo'; require ::($m); if $m ~~ Failure { die "$m not loaded" } 10:57
i don't bail there, but the module isn't loaded and my prog fails later when attempting to access it. hm, i'll try to test that at the require point. docs may need a little tweak... 10:59
habere-et-disper @discord-raku-bot: Experimenting with readability. Not sure if it helps here. 11:03
Nahita tbrowder: hi, if `require` fails to find the module, it will `fail` and since it's in sink context, the program will die at that point, no? Also `$m` is a defined String so it's not a Failure? Documentation shows `try` require'ing with lookup and then checking ::($m) ~~ Failure 11:09
leont Nemokosch: I will open a ticket as soon as I narrowed it down. It's tricker than I thought 11:12
tellable6 leont, I'll pass your message to Nemokosch 11:13
habere-et-disper Is there a recommended way to iterate within a method chain? 11:20
Voldenet m: my $m = "Foo"; if (try require ::($m)) === Nil { die "$m not loaded" } 11:22
camelia Foo not loaded
in block <unit> at <tmp> line 1
Voldenet habere-et-disper: *iterate* meaning what, something like .map? 11:30
(^10).map({ $_ * 3 }).say 11:33
evalable6 (0 3 6 9 12 15 18 21 24 27)
Voldenet alternatively 11:34
m: (^10).&{ gather { for $_ { take $_ * 3 } } }.say
camelia (0 3 6 9 12 15 18 21 24 27)
Voldenet there's even more ways to do that 11:40
11:50 linkable6 left, evalable6 left 11:51 evalable6 joined 11:52 linkable6 joined, MoC joined
leont I really need to write a solution for the enum issue I mention, because I just hit it for the third time this week 11:58
*mentioned at the conference
12:07 bigdata joined, reportable6 left 12:09 reportable6 joined
habere-et-disper @Voldenet++ Map does a single pass. I'm looking to do multiple passes... 12:35
m: my %VOWELS = < A 1 E 2 I 3 O 4 U 5 >.pairup; say <AEIOU>.comb.map( *.subst( .key, .value ) with %VOWELS )
camelia ===SORRY!=== Error while compiling <tmp>
Unable to parse expression in argument list; couldn't find final ')' (corresponding starter was at line 1)
at <tmp>:1
------> .comb.map( *.subst( .key, .value ) with ⏏%VOWELS )
tbrowder nahita: thanks. the syntax (....) and " 12:36
die does what i need
(try require ::($m)) === Nil and die "FATAL: msg"; 12:38
i don't grok it but it works. to me the whole try/CATCH blurb in the docs needs a rework. not many practical examples for my use. 12:39
i 12:49
12:49 habere-et-disper left
Voldenet >(try require ::($m)) === Nil and die "FATAL: msg"; 13:17
this syntax is fancy and confusing way to write `if (try require ::($m)) === Nil { die "$m not loaded" }`
13:26 otpv joined
lizmat just realized that the next App::Rak version will have 90+ options 13:44
CIAvash `try require ::('Test'); die "FATAL: $_" with $!`? 13:45
s/'Test'/$m/
leont Oh FFS. Apparently I can't pre-declare an enum, and taking it out of the class it's currently in means it will leak over the main namespace instead of just that class.
14:02 habere-et-disper joined
leont «Circularity detected in multi sub types», that is a new error! 14:19
14:26 habere-et-disper left 14:30 xinming left 14:31 xinming joined 14:43 MoC left
tbrowder Voldenet: thanks, yes, and that’s golfing code to me, but writing it that does look more natural. 14:56
but that’s part of the charm of Raku! 14:57
15:05 otpv left 15:33 bigdata left
Voldenet uhm, in many langs you can use && for ifs, but in all of them it's an ugly hack 15:50
Nemokosch Shell vibe 15:56
`or die`
16:33 evalable6 left, linkable6 left 16:34 linkable6 joined 16:36 evalable6 joined 16:48 eseyman left
ugexe leont: could you do `{ my enum ...; class Foo { ... } } }`? 16:51
leont My problem with the current behavior is that the values leak out. I do need the type to be out there. 16:52
I can't get one behavior without the other
ugexe it shouldnt leak out of that outer lexical scope in my example though 16:54
m: { my enum XX <a b c>; class Foo { method bar { say a } } }; say a; 16:55
camelia ===SORRY!=== Error while compiling <tmp>
Undeclared routine:
a used at line 1
ugexe m: { my enum XX <a b c>; class Foo { method bar { say a } } }; Foo.new.bar;
camelia a
ugexe although yeah even if that does what you want its still a workaround 16:56
leont I'm probably going to try to write a trait to make it not do that 16:57
It's easy enough to sabotage the exporting of values, but in the original scope it's rather hardcoded at the moment 16:58
ugexe yeah, and i guess my example doesn't get you the e.g. XX
CIAvash leont: yeah I have problem with enums exporting values by default as well. Maybe I should open an issue for it. This is what I did in my module: codeberg.org/CIAvash/APISports-Foo...od#L70-L78 17:00
leont CIAvash: this seems to work for exports pastebin.com/JU1LyC4r 17:03
CIAvash interesting 17:08
leont Should maybe release that as a module, but was distracted by other projects 17:10
17:32 Kaipei left 17:39 Util_ is now known as Util 17:43 eseyman joined, Sgeo joined 18:07 reportable6 left, reportable6 joined 18:17 Kaiepi joined 18:39 mexen left 19:06 habere-et-disper joined
habere-et-disper I was expecting the following two to be equivalent: 19:07
m: say 1..10 X**2
camelia (1 4 9 16 25 36 49 64 81 100)
habere-et-disper m: say 1..10 X²
camelia ((1 2) (2 2) (3 2) (4 2) (5 2) (6 2) (7 2) (8 2) (9 2) (10 2))
habere-et-disper I am thinking wrong?
19:43 xinming left 19:44 xinming joined 19:46 epony left 19:51 swaggboi left
japhb habere-et-disper: The first one is X'ing the infix **, the second is trying to X a postfix, with no second array. So instead it sees the superscript 2 as the only element of the second array, not as the postfix operator. 19:55
19:57 epony joined
habere-et-disper @japhb++ I think clarity lies in seeing ** as infix and superscript 2 as postfix when cross requires(?) infix 20:00
20:16 YULO joined
Nemokosch so why did the second succeed exactly? 20:24
habere-et-disper @discord-raku-bot: This one has caught me out before. I think implicitly there is a default list constructor (comma) implied. So... 20:33
m: say ( (1..10) X² ) eqv ( (1..10) X,² )
camelia True
leont «Impossible coercion from 'Composer' into 'Composer': method COERCE returned an instance of Composer» that is not a very helpful error (but the problem was PEBCAK of course) 20:41
21:16 linkable6 left, evalable6 left 21:17 linkable6 joined, evalable6 joined 21:19 lucs_ is now known as lucs 21:20 kaskal left 21:27 swaggboi joined 21:38 Sgeo left 21:55 Sgeo joined 22:22 sena_kun left 23:09 otpv joined 23:11 kaskal joined 23:20 perlbot left, simcop2387 left 23:31 Sgeo left 23:33 Guest2457 is now known as clarjon1 23:37 euandreh left 23:38 simcop2387 joined 23:39 perlbot joined 23:51 Sgeo joined