00:04 frost joined 00:12 frost left 01:09 kaiepi joined 01:48 kaiepi left 03:53 Guest35 left 07:53 kaiepi joined 08:05 dakkar joined 08:19 kaiepi left 08:22 kaiepi joined 08:26 kaiepi left 08:28 kaiepi joined 08:49 sivoais left 08:50 sivoais joined 09:08 frost joined 09:22 discord-raku-bot left, discord-raku-bot joined
Anton Antonov I am trying to redirect stderr to a custom $err. I am have this code: 11:10
```
my Str $err = '';
my $*ERR = $*ERR but role {
method print (*@args) {
$err ~= @args
}
}
```
Which worked before I updated to Raku 2022.04. Now I get the error: "Cannot resolve caller print(Any:U: BOOTStr); none of these signatures matches: (Mu: *%_)" 11:11
How can I fix this? 11:12
12:15 frost left 12:20 frost joined 13:10 Guest35 joined 13:53 TempIRCLogger left 13:55 lizmat left 14:17 kaiepi left 14:18 kaiepi joined 14:20 frost left 14:39 kaiepi left 15:48 kaiepi joined 16:01 kaiepi left 16:03 kaiepi joined
MasterDuke Anton Antonov: i don't get that error running just the code you pasted. is there more required to trigger it? 16:10
16:30 dakkar left 16:36 TempIRCLogger joined, lizmat joined 16:40 TempIRCLogger left, TempIRCLogger joined
Anton Antonov MasterDuke -- Ok, I will try to give an example. 17:16
MasterDuke -- Ok, I will try to give an example that has the error.
18:02 Manifest0 joined 19:15 n1to joined 19:19 n1to left 19:20 n1to joined
piotrklibert How come `[Z]` or `(1, 2) Z (2, 3) Z (3, 4)` work? Reduce over zip also works: `reduce(&zip, [(1, 2), (2, 3), (3, 4)])` Again, how come? 19:20
Semantically, all these should be reducible to: `zip( zip( (1, 2), (2, 3) ), (3, 4) )` which does give the result I'd expect: `(((1 2) 3) ((2 3) 4))`. Same for `((1, 2) Z (2, 3)) Z (3, 4)` so I was suspecting some operator precedence magic, but reduce/zip makes me think it's a special case in the `zip` multi (if it's a multi). This should be equivalen to `[Z]`, too, yet isn't:
```
> dd my @a = reduce(-> @a, @b { say "acc={@a.raku}, el={@b.raku}, ret=" ~ (my @r = @a Z @b).raku; @r}, [(1, 2), (2, 3), (4, 5)])
acc=(1, 2), el=(2, 3), ret=[(1, 2), (2, 3)]
acc=[(1, 2), (2, 3)], el=(4, 5), ret=[($(1, 2), 4), ($(2, 3), 5)]
Array @a = [($(1, 2), 4), ($(2, 3), 5)]
```
What am I missing?
Something about nodality, or scalar vs. array contexts, maybe? 19:22
19:28 discord-raku-bot left 19:29 discord-raku-bot joined
gfldex m: &reduce.candidates[0].signature.say; # bot? you there? 19:29
MasterDuke m: &reduce.candidates[0].signature.say; 19:30
camelia (&with, +list)
gfldex <@486998692683841566> see docs.raku.org/language/functions#S...onventions "single argument rule" 19:31
piotrklibert Ah, this again... 😄 Ok, thanks, I think it's finally time to actually understand that section instead of just reading it 🙂 19:35
Morfent slurpy oneargs are pretty handy 19:37
19:39 discord-raku-bot left, discord-raku-bot joined
Anton Antonov MasterDuke, I use(d) Test::Output to capture the error output -- works fine. The complication was coming from using my crude approach inside a Cro routing service. 20:17
Nemokosch I don't see much "single argument" here, how is this related? 21:41
I only see a question about associativity and Z has the so called list associativity
So neither left nor right, it acts like one function expanding to several arguments 21:42
docs.raku.org/language/operators#O...ociativity 21:45
<@486998692683841566> docs.raku.org/language/functions#Associativity you can do this, too :) 21:47
22:24 n1to left