This channel is intended for people just starting with the Raku Programming Language (raku.org). Logs are available at irclogs.raku.org/raku-beginner/live.html
Set by lizmat on 8 June 2022.
01:19 deoac joined
deoac How do you declare a Hash of Hash of Int? 01:21
And how do you initialize it in the `my` statement? 01:52
02:06 deoac left 03:32 frost joined
lizmat m: my Hash[Int] %h; %h<a> = (my Int %i = b => 42); dd %h 08:23
camelia Hash[Hash[Int] %h = (my Hash[Int] % = :a($(my Int % = :b(42))))
lizmat m: my Hash[Int] %h; %h<a> = (my Int % = b => 42); dd %h
camelia Hash[Hash[Int] %h = (my Hash[Int] % = :a($(my Int % = :b(42))))
10:55 frost left 13:16 jaguart joined
jaguart Would someone please point me to hints for the Moo eqiv of lazy builder 13:18
ie is lazy building readily supported in Raku classes? 13:19
lizmat jaguart: please remind me of the Moo definition of a lazy builder ? 13:23
jaguart class attribute: has $expensive is lazy, builder => sub { Expensive->new( $_[0]->tweak ) }; 13:24
so that $expensive only gets built when first used/accessed 13:25
lizmat not in core Rakudo afaik 13:26
in module space, maybe
jaguart thanks - I'll search in raku.land
lizmat raku.land/zef:jonathanstowe/Attribute::Lazy 13:27
jaguart yeah - doh that was fast, sorry should have checked there first :blush
lizmat yeah... no worries 13:28
Nahita there's also this i think: <raku.land/zef:vrurg/AttrX::Mooish> 13:46
jaguart thanks :) Attribute::Lazy seems to be working fine -> will check the Mooish too 13:59
lizmat jaguart: possibly also of interest: raku.land/zef:lizmat/Object::Delayed 14:12
14:30 razetime joined 15:18 razetime left 15:26 razetime joined 15:44 discord-raku-bot left, discord-raku-bot joined 15:50 discord-raku-bot left, discord-raku-bot joined
jaguart what is the different intent for submethod BUILD vs submethod TWEAK ? 16:15
lizmat jaguart: tomorrow: conf.raku.org/talk/183 Be smart – be lazy! Provided to you by AttrX::Mooish 16:16
TWEAK is run *after* all attribute initialization has been done
Nemokosch oh 16:17
lizmat BUILD runs before that... generally, it is recommended to use TWEAK nowadays
Nemokosch good to know that we get to hear about this
jaguart oh thanks for the conference pointer too :)))
hmmm - been arguing with Semantic::Versioning until I realised my $v.^name is 'Version' - :o there's a builtin Version class !!! ~jaw-drop 16:37
lizmat m: dd v0.0.1.^name 16:39
camelia "Version"
lizmat even the version literals are Version objects :-)
16:41 deoac joined
jaguart I am amazed, agog and astonished - wowser! 16:42
lizmat Raku comes with a *lot* of things built in
m: say π 16:44
camelia 3.141592653589793
lizmat m: say τ
camelia 6.283185307179586
lizmat m: say 42 ∈ (17,66,84,42,15)
camelia True
17:22 razetime left 20:20 discord-raku-bot left, discord-raku-bot joined