|
00:32
ds7832 left
02:41
kylese left
02:42
kylese joined
03:15
kylese left,
kylese joined
03:37
sibl joined
03:48
johnjay left
04:33
cm_ joined
04:34
cm left,
cm_ is now known as cm
04:36
arkiuat left
04:48
arkiuat joined
04:53
arkiuat left
05:02
Aedil joined
05:03
arkiuat joined
07:34
abraxxa joined
07:40
abraxxa left,
abraxxa joined
07:53
Aedil left
08:02
Aedil joined
08:06
Sgeo left
08:37
sibl left
08:56
dakkar joined
09:03
sibl joined
09:32
arkiuat left
09:35
sibl left
09:46
arkiuat joined
09:51
arkiuat left
10:00
arkiuat joined
|
|||
| nemokosch | Either way, is built should be treated as the interface of the class | 10:02 | |
|
10:04
arkiuat left
10:08
sibl joined
|
|||
| Voldenet | `is built(:bind)` can be used when binding is wanted, obviously | 10:17 | |
| m: my $debug = 0; my @a = do for ^10 { class { has $.debug is built(:bind) }.new(:$debug); }; $debug = 1; say @a # something like this without bind is a bit more verbose | 10:18 | ||
| camelia | [<anon|1>.new(debug => 1) <anon|1>.new(debug => 1) <anon|1>.new(debug => 1) <anon|1>.new(debug => 1) <anon|1>.new(debug => 1) <anon|1>.new(debug => 1) <anon|1>.new(debug => 1) <anon|1>.new(debug => 1) <anon|1>.new(debug => 1) <anon|1>.new(debug => 1)] | ||
| Voldenet | m: my %env = :!debug; my @a = do for ^10 { class { has %.env is built(:bind) }.new(:%env); }; %env<debug> = True; say @a # not a lot more verbose though | 10:19 | |
| camelia | [<anon|1>.new(env => {:debug(Bool::False)}) <anon|1>.new(env => {:debug(Bool::False)}) <anon|1>.new(env => {:debug(Bool::False)}) <anon|1>.new(env => {:debug(Bool::False)}) <anon|1>.new(env => {:debug(Bool::False)}) <anon|1>.new(env => {:debug(Bool::F… | ||
| lizmat | I'd say the implementation of is built(:bind) currently is incorrect | 10:20 | |
| Voldenet | …huh | ||
| m: my %env = :!debug; my @a = do for ^10 { class { has $.env is built(:bind) }.new(:%env); }; %env<debug> = True; say @a # huh…? | 10:21 | ||
| camelia | [<anon|1>.new(env => {:debug(Bool::True)}) <anon|1>.new(env => {:debug(Bool::True)}) <anon|1>.new(env => {:debug(Bool::True)}) <anon|1>.new(env => {:debug(Bool::True)}) <anon|1>.new(env => {:debug(Bool::True)}) <anon|1>.new(env => {:debug(Bool::True)}… | ||
| Voldenet | something definitely weird is going on | ||
| m: my %env; class { has %.env is built(:bind) }.new(:%env).env.WHICH.say; %env.WHICH.say # if bind worked, these would be probably the same | 10:26 | ||
| camelia | Hash|2234447014368 Hash|2234447015808 |
||
| nemokosch | I tend to say that the only well-behaved sigil is $ | ||
| a bit of an overstatement - & is quite sane, too | 10:27 | ||
| Voldenet | $ is boring, @ and % are for true adventureres | 10:28 | |
| adventurers* | |||
| though tbh. they mostly behave like I expect | 10:29 | ||
| m: my %env; my %env2 := %env; say (%env.WHICH, %env2.WHICH) | |||
| camelia | (Hash|6288219912096 Hash|6288219912096) | ||
| nemokosch | probably the most immediate, most annoying thing is that they don't have a proper undefined state | 10:30 | |
| the second most annoying thing is this hacky assignment behavior they have, with different precedence and all | |||
|
10:34
arkiuat joined
|
|||
| Voldenet | the latter I would say is useful | 10:34 | |
| m: my %n = :a, :b; say %n # I do plenty of this | 10:35 | ||
| camelia | {a => True, b => True} | ||
|
10:36
sibl left
|
|||
| Voldenet | no undefined state can be annoying or very useful depending on the use case | 10:36 | |
| instead of `List<int> x = new List<int>()` you can simply `@x` and it's equivalent code | 10:37 | ||
| nemokosch | useful but at what cost? I'd argue something could be useful at a lower cost, or just not be "useful" but at least teachable | ||
| for example, my $n = :a, :b; really could have worked like that | 10:38 | ||
| even without this copout, having a context-sensitive precedence-shifting operator is a huge cost | 10:39 | ||
|
10:39
arkiuat left
|
|||
| it's not only hard to document, it's hard to even conceptualize | 10:39 | ||
| Voldenet | well, currently this simply doesn't work | ||
| m: my $n = :a, :b; # but it does know what you're trying to do! | 10:40 | ||
| camelia | WARNINGS for <tmp>: Useless use of constant value :b in sink context (lines 1, 1) Useless use of ":b" in sink context (lines 1, 1) |
||
| Voldenet | sort of | ||
| nemokosch | and no undefined state is not a feature because you can't opt out of it, it's a constraint | ||
| for $variables, it is a feature that you can choose | |||
| in particular named parameters with @ or % sigils basically cannot detect ommission; you cannot even specify ommission for them | 10:42 | ||
| how do I know? well, I ran into it back then | |||
| we also know that swapping the contents of two @variables will do something crazy | 10:44 | ||
| (@a, @b) = (@b, @a) will feed a recursive structure into @a | |||
| anyway, I think everybody currently present already knows these | 10:45 | ||
| Voldenet | Yeah, these things are simply surprising | 10:46 | |
| it's possible to do "undefined" @ if you're crazy | 10:50 | ||
| m: use MONKEY-TYPING; augment class List { method def() { 0 }; }; role Defined { has $.def = 1 }; sub x(@n?) { say @n.def }; x(); x(() but Defined) | |||
| camelia | 0 1 |
||
| Voldenet | that probably could be more constant | 10:51 | |
| with `method def() { 1 }` | |||
| in fact the whole Defined marker would be enough | 10:52 | ||
| m: role Defined { }; sub x(@n?) { say @n ~~ Defined }; x(); x(() but Defined) | |||
| camelia | False True |
||
| Voldenet | though it's a bit backwards, because you then start to reimplement features that Scalar simply has… | 10:53 | |
| nemokosch | Yeah, "don't try this at home" 🙂 | 10:56 | |
| Voldenet | on the other hand, if you actually want a collection that you can simply iterate without clunky `if $n.defined { for $n<> { } }` `@n?` as argument is very useful | 11:01 | |
| m: sub foo($n?) { .say for $n<> }; foo() # otherwise you get this insanity | 11:03 | ||
| camelia | (Any) | ||
|
11:07
arkiuat joined
|
|||
| nemokosch | I honestly think this "$var will be iterated as one entity", or in other words, "identity means itemization" was a mistake | 11:12 | |
|
11:12
arkiuat left
|
|||
| that's the main reason not only for the for weirdness but the stubborn multi-dimensional arrays as well | 11:12 | ||
| m: [[1, 2], [3, 4]].flat.say | 11:13 | ||
| the evalbot really could work in this channel as well - more advanced users can evaluate it in their heads | |||
| lizmat | m: [[1, 2], [3, 4]].flat.say | ||
| camelia | ([1 2] [3 4]) | ||
| lizmat | m: ([1, 2], [3, 4]).flat.say | 11:14 | |
| camelia | (1 2 3 4) | ||
| Voldenet | m: [[1, 2], [3, 4]].flat(:hammer).say # proper tool for stubborn arrays | ||
| camelia | (1 2 3 4) | ||
| lizmat | m: [[1, 2], [3, 4]].List.flat.say | 11:15 | |
| camelia | (1 2 3 4) | ||
|
11:30
arkiuat joined
11:33
librasteve_ joined
|
|||
| librasteve_ | notable6: weekly | 11:33 | |
| notable6 | librasteve_, 8 notes: gist.github.com/f5d97c17f1cdf19872...15c6304ef9 | ||
|
11:36
arkiuat left
|
|||
| nemokosch | I know but it feels more like a workaround of a self-inflicted problem | 11:38 | |
| librasteve_ | notable6: weekly reset | 11:53 | |
| notable6 | librasteve_, Moved existing notes to “weekly_2026-02-09T11:53:16Z” | ||
|
12:05
arkiuat joined
12:09
arkiuat left
|
|||
| librasteve_ | rakudoweekly.blog/2026/02/09/2026-...n-gymraeg/ | 12:15 | |
|
12:32
arkiuat joined
12:36
arkiuat left
|
|||
| Voldenet | m: $_ = 3; -> $_ is raw { $_ = 4; }(my $x); say $_; #OUTPUT 4 | 12:50 | |
| camelia | 3 | ||
| Voldenet | wrong output in weekly ;p | ||
| lizmat | librasteve_ ^^ | 12:51 | |
|
12:55
arkiuat joined
12:59
arkiuat left
|
|||
| librasteve_ | oops … red face … fixed now | 13:02 | |
|
13:16
arkiuat joined
13:20
arkiuat left
13:30
arkiuat joined
13:34
arkiuat left
14:04
arkiuat joined
14:09
arkiuat left
14:16
stanrifkin joined
14:33
arkiuat joined
15:37
simcop2387 left
15:44
arkiuat left
15:48
arkiuat joined
15:54
arkiuat left
16:08
dano1 joined
16:09
arkiuat joined
16:10
cm_ joined,
merpp joined
16:11
greaser|q joined,
Ekho- joined
16:12
GreaseMonkey left
16:13
facetious joined,
cm left,
merp left,
cm_ is now known as cm,
Ekho left,
tailgate left
16:15
arkiuat left
16:16
Ekho- left,
dano left,
dano1 is now known as dano
16:18
Ekho joined,
arkiuat joined
16:23
arkiuat left,
simcop2387 joined
16:50
arkiuat joined
16:56
arkiuat left
16:58
arkiuat joined
17:03
arkiuat left
17:24
abraxxa left
17:32
arkiuat joined
17:34
dakkar left
17:37
arkiuat left
17:40
arkiuat joined
18:17
sftp left
18:44
jgaz joined
18:48
silug joined
18:53
derpydoo left
19:15
notna joined
|
|||
| aruniecrisps | @librasteve wanted ask if you saw my message in #cro | 19:16 | |
|
19:21
stanrifkin left
19:58
oodani left
20:01
oodani joined
20:50
notna left,
notna joined,
notna left
20:56
oodani left
20:57
oodani joined
21:12
stanrifkin joined
21:16
greaser|q left,
greaser|q joined,
greaser|q is now known as GreaseMonkey
22:19
arkiuat left
22:22
arkiuat joined
22:27
arkiuat left
22:55
arkiuat joined
22:59
arkiuat left
23:11
sorenson left
23:12
stanrifkin left,
arkiuat joined
23:14
sorenson joined
23:36
simcop2387 left
|
|||