🦋 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:16 SmokeMachine left, Grinnz left 00:17 skaji_ left 00:18 skaji_ joined, Grinnz joined, SmokeMachine joined 00:19 ChoppedBacon joined, kawaii joined, tbrowder joined 00:21 jhill joined 00:34 notagoodidea left 00:46 pecastro left 01:25 kst left 01:31 Black_Ribbon left 01:36 kst joined 01:50 summerisle left 01:51 summerisle joined 02:25 kvw_5_ joined 02:28 kvw_5 left 02:58 rindolf joined 03:46 xinming_ joined 03:50 xinming left
guifa2 if using the EXPORT sub, how would one export a term? I tried just adding, e.g. 'foo+' as one of the export keys, but that bombs 03:52
04:12 wamba joined
Geth roast: 2800632eb0 | (Zoffix Znet)++ | S02-types/baghash.t
Can .grab() a BagHash key with weight larger than 64 bits

RT#132279: rt.perl.org/Ticket/Display.html?id=132279
04:26
tyil welp, Geth appears to work :D 04:27
04:53 guifa2 left 05:12 Black_Ribbon joined 05:30 [Sno] left 05:36 brtastic joined 05:37 sno joined 06:13 jmerelo joined 06:28 gordonfish left, gordonfish- joined 06:29 gordonfish- left, gordonfish- joined 06:41 db48x joined 07:00 ufobat__ joined 07:01 Sgeo left 07:09 ufobat__ left 07:10 ufobat joined
db48x does anyone know how raku knows which punctuation characters are paired for use in a regex? 07:13
a few minutes searching reveals github.com/rakudo/rakudo/blob/mast...r.nqp#L260 07:15
the caller knows the goal character, but I can't find the caller 07:16
07:20 sjm_uk joined 07:39 aindilis left 07:59 abraxxa joined, parabolize left 08:03 abraxxa left 08:04 abraxxa joined 08:05 domidumont joined 08:08 MasterDuke joined 08:25 Garbanzo left 08:29 tejr left 08:33 dakkar joined 08:40 gnufr33dom left 08:42 tejr joined 08:49 dpk left, dpk joined 08:52 bartolin joined 08:58 pecastro joined, Scimon joined 09:12 gnufr33dom joined 09:35 ensamvarg195 joined, ensamvarg195 left 09:37 ensamvarg195 joined 10:05 aborazmeh joined, aborazmeh left, aborazmeh joined 10:18 MasterDuke left 10:20 MasterDuke joined 10:36 JRaspass joined 10:39 lizmat_ joined 10:42 lizmat left 10:44 lizmat joined 10:48 brtastic left, lizmat_ left 11:00 gnufr33dom left 11:06 aborazmeh left, wamba left 11:07 dakkar left 11:08 dakkar joined 11:10 guifa2 joined 11:22 tobs left, tobs joined 11:24 JRaspass left 11:26 sftp left, mniip joined 11:28 sftp joined 11:36 Black_Ribbon left 11:44 ufobat_ joined 11:48 ufobat left 12:00 wamba joined 12:04 mowcat joined
timotimo i think FAILGOAL is called from the a ~ b c construct 12:07
12:19 wamba left
rindolf mniip: hi, there? 12:19
12:19 cgfbee left, wamba joined 12:21 xkr47 joined, [ptc] joined 12:24 cgfbee joined 12:26 vike left 12:44 Kaiepi left 13:34 mowcat left 13:49 vike joined 13:50 a3f joined 13:51 andinus left
tbrowder hi, gang 14:03
if i have a class instance, how do i make it take certain actions if the caller exits the program prematurely? i am used to using the END block for non-class things, but i'm sure there are other considerations for a class instance. 14:07
the main action i'm thinking about is saving the current open file content, closing that file, and reporting status to stdout. 14:10
the class has an attribute for the open file handle and name. 14:11
14:39 dmc7z joined
guifa2 You can get the END phaser to work on a class level, but not on an instance level AFAIK 14:40
theoretically you have method DESTROY, but there's no guarantee that will be called
moritz yes, you'd have to do some magic to keep a list of all open instances 14:41
and then in the END phaser, close them all
XOR require your caller to call a .close or .finish method or so on each instance, and make it the caller's responsiblity
and then the caller can do something like my $instance = YourClass.new() will leave { $instance.close } # or however the "will" trait works 14:42
docs.raku.org/language/phasers#ind...will_trait
guifa2 this is probably the easiest, TBH: tio.run/##TY5BCsJADEX3c4pPcSldumgR...GHp3IZ0Yfw 14:43
And then add another method, if necessary, to remove stuff from thel ist as needed
dakkar one problem I see with that, is that all the instances will be kept alive throughout the life of the process… 14:44
(one of the few times where perl's weak refs are very useful) 14:45
14:47 wamba left 14:49 lucasb joined
tbrowder some caveats for now: one instance, one file 14:50
14:52 wamba joined
tbrowder so, given my caveats, it looks like the END should work. thanks, 14:55
guifa: thanks 14:56
moritz: thanks
dakkar: thanks
dakkar m: class Foo { submethod TWEAK() { END { say "would kill {self}" }}; my Foo $a .= new; my Foo $b .= new; say "foo $a $b";
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3 new; my Foo $b .= new; say "foo $a $b";7⏏5<EOL>
dakkar m: class Foo { submethod TWEAK() { END { say "would kill {self}" } } }; my Foo $a .= new; my Foo $b .= new; say "foo $a $b";
camelia foo Foo<65263536> Foo<65263568>
would kill Foo<65263568>
14:57 parabolize joined
dakkar notice that each END in the source code gets installed / executed exactly once 14:57
guifa2 dakkar: indeed, that's what I meant to remove stuff from the list as available. Could probably fairly easily make a "register" and "deregister" class method that the instances call
tio.run/##ZZBBqsJAEET3c4pCslAIATcu...pBF@3lOD4B
dakkar guifa2: SetHash 😜 14:58
but yes
guifa2 dakkar: lol fair. I don't really use sethash that often, I probably should more often
15:02 Sgeo joined 15:17 MasterDuke left 15:18 mowcat joined 15:22 brtastic joined
lizmat SN9 launch in about 30 minutes: www.youtube.com/watch?v=NtGutb1R5cQ 15:28
15:28 raku-bridge left, raku-bridge joined
[Coke] lizmat++ 15:33
15:33 JRaspass joined
lizmat looks like it's postponed by 30 mins 15:45
16:06 brtastic left 16:19 ensamvarg195 left 16:20 b2gills1 left 16:21 brtastic joined 16:28 gordonfish- is now known as gordonfish 16:30 MasterDuke joined 16:36 RaycatWhoDat joined 16:37 seanrobert joined 16:38 b2gills joined
RaycatWhoDat Hey. Got a question about sequences. What are the nuances of making sequences? Any gotchas? 16:39
tbrowder the END in TWEAK works very well for my use case! 16:41
16:44 seanrobert left
jmerelo RaycatWhoDat: they're lazy by default. 16:45
tellable6 2021-01-24T08:14:44Z #raku <guifa2> jmerelo I've got the talk down to 52 minutes, exporting the video but looks like my laptop will take a bit. Sleeping now but will upload it in the AM and see if I can cut down a few more minutes to do an afternoon upload
16:45 wamba left
jmerelo .tell guifa2 OK 16:45
tellable6 jmerelo, I'll pass your message to guifa2
RaycatWhoDat jmerelo: Gotcha. 16:46
tbrowder oops, END in TWEAK fires even though no class object exists! and i get an exception for attempting a method on a null object. 16:56
trying a "tweak"... 16:57
RaycatWhoDat How do you specify a sequence with a constraint? 16:59
Something like 1, 1, * + * ... * where * is less than 13 17:00
Seems like I'm just getting (Nil)s
tbrowder i fixed it (so far) with "END { if self { self.meth }}" 17:01
MasterDuke m: .say for 1, 1, * + * ... * > 13
camelia 1
1
2
3
5
8
13
21
RaycatWhoDat Hmm
.say for 1, 1, * + * ... * >= 13 17:02
evalable6 1
1
2
3
5
8
13
RaycatWhoDat Ah
That's the problem
Thank you
MasterDuke np
dakkar tbrowder: reminder that, in the general case, you have no way of knowing which object that END block gets called on 17:29
17:30 Scimon left, MasterDuke left
tbrowder oh, ok, hm. any way around that? 17:31
dakkar what guifa2 suugested: keep a set of instances 17:35
17:35 Noisytoot joined
dakkar m: class Foo { submethod TWEAK() { END { say "would kill {self}" } } }; my Foo $a .= new; my Foo $b .= new; say "foo $a $b"; 17:35
camelia foo Foo<77087728> Foo<77087760>
would kill Foo<77087760>
dakkar if you only ever create 1 instance, you may get away with that, but at least put a comment explaining the potential problem ☺ 17:36
dakkar disconnects
17:41 dakkar left 17:47 aindilis joined 17:48 wamba joined 18:14 gnufr33dom joined 18:21 natrys joined 18:26 domidumont left
lizmat and another Rakudo Weekly News hits the Net: rakudoweekly.blog/2021/01/25/2021-...reporting/ 18:38
perry lizmat, where's that picture from? 18:39
lizmat If I remember correctly, it is near Kenso in Scotland 18:40
perry Ha! I was going to guess Scotland. Too bad I didn't ;p
lizmat sadly it was taken with our D800, which doesn't have geoloc hardware :-( 18:41
18:41 japhb joined 18:43 dmc7z left
lizmat afk& 18:46
18:47 RaycatWhoDat left 18:50 ssm__ left 18:51 tejr left, asymptotically left, xelxebar left 19:02 RaycatWhoDat joined 19:06 Garbanzo joined
rba . 19:09
tellable6 2020-12-30T11:49:05Z #raku <patrickb> rba A new rakubrew release (v15) is ready for upload. The website itself can also be updated. (As always: rooster.uber.space/patcloud/index....JLQDZcjbf)
rba patrickb: The new release is (finaly) installed. The website did not work to update. The error is in the email I sent you. Let me know when we can trouble-shoot it. 19:11
tellable6 rba, I'll pass your message to patrickb
19:12 ssm__ joined 19:21 RaycatWhoDat left 19:25 berber44 joined 19:27 RaycatWhoDat joined 19:36 pilne joined
pilne so, i'm loving the zip download with the set-env.bat file, it's great for learning with raku wherever i can take my USB stick, i've just got a quick question about where zef will install modules to by default with that setup, will it dump them in the extracted file structure somewhere (good) or in userspace somewhere(bad)? thanks in advance! 19:37
El_Che lizmat: d800? you hipster. I have the D700 :)
19:40 jmerelo left 19:41 berber44 left 19:51 pilne left, pilne joined, tejr joined, tejr left 19:52 ufobat joined, tejr joined 19:55 ufobat_ left 19:58 sjm_uk left 20:01 RaycatWhoDat left 20:04 brtastic left, asymptotically joined, xelxebar joined
tony-o pilne: zef defaults to site#, if you wish to force it you can use `zef install --install-to ...` 20:09
20:10 rindolf left
pilne ty 20:12
i don't want to be dumping raku modules and such all over my corporate box, even if i'm finding ways to use raku to make my job easier :D
20:12 ufobat left
guifa2 tony-o: as we transition to fez, would you recommend us continuing to post one of the other ecosystems for the near future? 20:20
tellable6 2021-01-25T16:45:46Z #raku <jmerelo> guifa2 OK
20:24 tejr left
tony-o pilne: you can find that out via 20:25
m: say $*REPO.repo-chain.grep({($_.^can('name')//(sub {0})).first.($_) eq 'site'}).first.abspath
evalable6 Use of Nil in string context
/tmp/whateverable/rakudo-moar/a3c7d00d84d50a0951c8ac5340dcb3a365aae601/share/perl6/site
in block at /tmp/6FokvMEm4f line 1
tony-o hm, that works on my box
20:25 tejr joined
tony-o you can also just dump $*REPO.repo-chain and look for the one that says `site` 20:26
guifa2: i'm not opposed to it just for posterity - people using older versions of zef would benefit from them being on p6c but ultimately i'd like to see p6c deprecate 20:27
guifa2 tony-o: yeah, agreed on wanting to se p6c fall to the wayside. I've been aiming (since we're early in adoption right now) only about a year's worth of deprecation before tossing stuff in my modules. 20:30
In this case, I feel like the best practice would be for my extant modules to stay on p6c for about a year after 6.e, when presumably most people would starting getting fresh installs of Raku with an updated zef.
tony-o agreed, there's a ton of cruft in p6c that will likely clean itself up by way of deprecation 20:54
going through it i think there are still modules without author/version/etc 20:55
is there someone available who knows more about modules.raku.org's internals that can test this branch? github.com/Raku/modules.raku.org/tree/zef-eco - this should put zef-eco on the modules.raku.org page 20:56
tbrowder tony-o: when you refer to modules w/o author info, etc., are you talking about those adverbs being in the module? 21:00
tony-o in the META
they're just basic {"name": "XY::Z", "description": "test"} 21:01
tbrowder if so, that’s one of the reason’s i’ve come to love mi6
ok, meta, got it. another thing i’ve been voting for: some minimal and testable standards for acceptable modules. 21:03
before they can be accepted as “official” in the modules.raku.org. 21:05
tony-o digging through modules.raku.org, i'm kind of liking the raku code for raku.land 21:06
21:08 natrys left 21:14 wamba left 21:32 guifa2 left 21:35 jhill left 21:36 skaji_ left, ChoppedBacon left 21:37 SmokeMachine_ joined, SmokeMachine left, SmokeMachine_ is now known as SmokeMachine, jhill joined, cpage_ joined 21:38 skaji_ joined, ChoppedBacon joined 21:40 cpage left, cpage_ is now known as cpage 21:41 guifa2 joined
guifa2 tbrowder: I had mention to lizmat that I've thought about also creating a curated list of modules — not in an ecosystem per se, but just a website that might be more purpose driven than name driven (e.g. "modules for handle XML", and a list of each of those with the differences — bindings to native libs, pure raku, performance, etc— or similarities — compatible APIs— being discussed). 21:45
21:48 perry left 21:50 perry joined
El_Che guifa2: isn't that a typical awsome repo? 21:50
guifa2 Perhaps, although I'm thinking of something a bit more detailed than what I tend to find there (and I'd still want to add in some search features) 21:53
JJAtria[m] tony-o: I saw a commit recently in zef that renamed the new ecosystem from "zef" to "fez". Does that have an impact on the correct auth to use? 21:55
21:55 vike left 22:01 MasterDuke joined 22:02 Altai-man_ joined 22:04 sena_kun left, vike joined 22:16 Possum joined
Geth doc: 0a50ecb084 | (Stoned Elipot)++ | doc/Type/Str.pod6
Fix apparent paste error
22:19
linkable6 Link: docs.raku.org/type/Str 22:20
22:20 JRaspass left 22:31 vike left 22:34 RaycatWhoDat joined
RaycatWhoDat Quick question because I think I'm doing it wrong. How can I return a running hash from an Action Object used by a Grammar? 22:34
glot.io/snippets/fv9pbgx61n 22:35
So, the above works but I want to do something like has %.all-flags inside of the class. 22:36
22:51 vike joined 23:06 RaycatWhoDat left, RaycatWhoDat joined 23:12 RaycatWhoDat left 23:19 gnufr33dom left
guifa2 RaycatWhoDat: what do you mean by a running hash? 23:20
tellable6 guifa2, I'll pass your message to RaycatWhoDat
23:20 Black_Ribbon joined 23:24 gnufr33dom joined 23:39 RaycatWhoDat joined
RaycatWhoDat . 23:41
tellable6 2021-01-25T23:20:24Z #raku <guifa2> RaycatWhoDat: what do you mean by a running hash?
RaycatWhoDat guifa2: Like, I want to add the keys and values to a hash as I parse the input.
Then return that hash at the end. 23:42
23:43 MasterDuke left 23:45 mowcat left
guifa2 So you can do that — but make sure there's no way your regex can backtrack, or you might end up pushing multiple times for the same value (I maaaaaaybe made that mistake once back in the day haha) 23:48
in the TOP rule, define a dynamic variable
and 'make' it at the end 23:49
rule TOP { :my %*result; ^^ ('-' <flag-with-values>)+ %% <.ws> $$ { make %*result } }
in your flag-with-values token, after you've matched everything, you can insert a small code block to assign to that hash, e.g. 23:50
token flag-with-values { <flag-name> <.ws> <flag-value> { %*result{~$<flag-name>} = ~$<flag-value> } } 23:51
Then just do your parsing, %options := OptionsParser.parse( $string ).made 23:52
RaycatWhoDat What's that `:my` syntax? 23:54
guifa2 that's how you declare a new variable in a regex scope
RaycatWhoDat Oh neat
guifa2 code blocks are their own local scopes inside of regex
RaycatWhoDat and the `~$<...>`? 23:56