🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Log inspection is getting closer to beta. If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 25 August 2021.
Jerry73 yo 00:17
guifa o/ 00:28
gfldex SmokeMachine: After carefull study of Rakudo, I now understand what you do with subset. There may be a host of cool stuff we can do with that. I shall blog later. 10:44
lizmat there's no goto in Raku either 10:45
gfldex But that doesn't mean Raku couldn't be your go-to language! :-> 10:46
Nemokosch can a postcircumfix operator be hypered as if it was an infix operator? 11:12
SmokeMachine gfldex: please let me know when you blog about it, I'm very interested! :)
gfldex lolibloggedalittle: gfldex.wordpress.com/2022/04/11/a-...et-of-red/
SmokeMachine gfldex: great post! And thanks for the recommendation! :) 11:16
gfldex You are very welcome. 11:17
I can now claim to understand subset.
CIAvash The error message part in where clauses were explored by zoffix blogs.perl.org/users/zoffix_znet/20...umans.html he even created a module for it github.com/raku-community-modules/Subset-Helper 11:55
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2022/04/11/2022-15-wordling/ 12:30
nine lizmat++ 17:53
El_Che lizmat is our unsung hero 19:04
Voldenet That may be a silly question, since it's not documented that it should work like that, but
m: (^5).produce( -> $a, $b { FIRST { take 42 }; $b }).say
camelia (0 1 2 3 4)
Voldenet shouldn't this return (0 42 1 2 3 4)?
docs state that produce is an implicit loop after all 19:05
Nemokosch where is the implicit gather, though? 19:08
[Coke] Voldenet: where do the docs state that? 19:09
Voldenet > docs.raku.org/type/List#routine_produce
> Since produce is an implicit loop, it responds to next, last and redo statements inside &with:
[Coke] ah, at the very bottom of docs.raku.org/routine/produce
Voldenet using FIRST is outside of scope of this though, that's why it's a silly question
however, it works in map 19:10
m: (^5).map(sub ($_) { FIRST { return 42 }; $_ }).say
camelia (42 1 2 3 4)
Voldenet m: (^5).produce(sub ($a, $_) { FIRST { return 42 }; $_ }).say
camelia (0 1 2 3 4)
Voldenet if you know what first element is, you can cheat though 19:11
m: (^5).produce(sub ($a, $_) { if $a == 0 { return 42 }; $_ }).say
camelia (0 42 2 3 4)
Nemokosch it's really interesting that map and produce don't work the same way 19:12
Voldenet produce uses gather/take and map doesn't 19:13
Voldenet m: (^5).produce(sub ($a, $_) { take 42; $_ }).say 19:15
camelia (0 42 1 42 2 42 3 42 4)
guifa it might be using it internally, but I don't it's something you should rely upon 19:18
Voldenet Yes, definitely not, especially if docs say nothing about it 19:20
…in fact, FIRST/LAST work weird in map 19:26
m: (^5).map(sub ($_) { FIRST { return 42 }; $_ }).say
camelia (42 1 2 3 4)
Voldenet m: (^5).map(sub ($_) { LAST { return 42 }; $_ }).say
camelia Attempt to return outside of immediately-enclosing Routine (i.e. `return` execution is outside the dynamic scope of the Routine where `return` was used)
in block <unit> at <tmp> line 1
Voldenet It's weird code nobody sane would write anyway, normal people would just use gather/take for anything complex 19:28
Geth doc/search-categories-update: 22 commits pushed by Altai-man++, Coke++
review: github.com/Raku/doc/compare/401383...78596bb717
21:12
[Coke] ^^ rebase 21:13