🦋 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.
Voldenet melezhik: compile it with debug symbols, attach gdb, print backtrace 00:07
[Coke] does XS not JustWork® with Inline::Perl5 ? 00:45
Voldenet just tried `use JSON::XS:from<Perl5>; say encode_json(<hello world>)` and it did work for me 01:19
tailgate You can setup delay: /set irc.look.smart_filter_delay 5 01:42
sorry, oops 01:43
guifa o/ 04:09
grondilu method fallbacks are not inherited? I've tried to inherit from JSON::RPC and got no method fallbacks. 09:07
Sorry I meant JSON::RPC::Client 09:08
m: class A { BEGIN $?PACKAGE.add_fallback: $?PACKAGE, -> $,$ { True }, -> $,$name { say "calling $name" } }; A.new.foo 09:10
camelia ===SORRY!=== Error while compiling <tmp>
An exception occurred while evaluating a BEGIN
at <tmp>:1
Exception details:
No such method 'add_fallback' for invocant of type 'A'
in code at <tmp> line 1
grondilu m: class A { BEGIN $?PACKAGE.HOW.add_fallback: $?PACKAGE, -> $,$ { True }, -> $,$name { say "calling $name" } }; A.new.foo
camelia calling foo
No such method 'CALL-ME' for invocant of type 'Bool'
in block <unit> at <tmp> line 1
grondilu m: class A { BEGIN $?PACKAGE.HOW.add_fallback: $?PACKAGE, -> $,$ { True }, -> $,$name { method { say "calling $name" } } }; A.new.foo 09:11
camelia calling foo
grondilu m: class A { BEGIN $?PACKAGE.HOW.add_fallback: $?PACKAGE, -> $,$ { True }, -> $,$name { method { say "calling $name" } } }; A.new.foo ; class :: is A {}.new.foo
camelia calling foo
No such method 'foo' for invocant of type '<anon|1>'
in block <unit> at <tmp> line 1
grondilu m: class A { BEGIN $?PACKAGE.HOW.add_fallback: $?PACKAGE, -> $,$ { True }, -> $,$name { method { say "calling $name" } } }; A.new.foo ; try class :: is A {}.new.bar 09:14
camelia calling foo
SmokeMachine m: class A { method FALLBACK($name, |c) { say "calling $name" } }; A.new.foo; class :: is A {}.new.bar 10:43
camelia calling foo
calling bar
tellable6 2022-04-21T02:24:56Z #raku-dev <melezhik> SmokeMachine hopefully I fixed SparkyCI performance and false negative issues , please try to run new builds for Red and let me know if you have any issue
SmokeMachine grondilu: ^^ 10:44
SmokeMachine .tell melezhik I'll try to fix some Pg tests as soon as possible to test it, thanks! 10:47
tellable6 SmokeMachine, I'll pass your message to melezhik
grondilu SmokeMachine: noted. I suppose I could tell the author of JSON::RPC to update his module to use FALLBACK instead add_fallback 10:58
Geth ¦ Documentable: JJ self-assigned Test failures github.com/Raku/Documentable/issues/160 12:35
¦ Documentable: JJ unassigned from antoniogamiz Issue Test failures github.com/Raku/Documentable/issues/160
RaycatWhoDat Hi, hello. 12:37
tellable6 2021-10-26T15:04:00Z #raku <dakkar> RaycatWhoDat: subset Command of Str where * ~~ /:i ^ EXIT $ /; loop { my $command = prompt(">>") // last; last if $command ~~ Command; say "I will do <$command>" }
RaycatWhoDat wha
Oh, I know what this is for
Thanks, dakkar
dakkar wow, apparently a few months ago I replied to a question of yours
RaycatWhoDat Yeah, this is probably for the orchestration thing I was fiddling with 12:38
I was using Raku as "Nicer Bash"
I'm currently running into the "This Seq has already been consumed" issue and I'm trying to grok how to actually solve it 12:39
I've done what the error asks me to do but it doesn't seem to work
Here's the non-functioning code: github.com/RayMPerry/kitchen-sink/...crypt.raku
Why doesn't adding the `.cache` method to the usages of `@translations` actually work? Am I misunderstanding something? 12:40
grondilu I encountered this error lately too. I solved it by using .eager
RaycatWhoDat `.eager` on the declaration? 12:41
err, assignment
Nemokosch what is that arrow thingy?
grondilu instead of `my $ = (^10).something` I wrote `my $ = (^10).something.eager^
RaycatWhoDat Nemokosch, it makes a Pair 12:42
grondilu or something like that, the details don't matter
Nemokosch oh right, I got confused
grondilu m: say .WHAT given my $ = (^10).base(16) 12:43
camelia No such method 'base' for invocant of type 'Range'. Did you mean any
of these: 'Bag', 'Hash', 'are', 'asec', 'hash', 'race', 'take'?
in block <unit> at <tmp> line 1
grondilu oops
m: say .WHAT given my $ = (^10).Str.flip
camelia (Str)
grondilu m: say .WHAT given my $ = (^10).map(*.Str.flip)
camelia (Seq)
grondilu m: say .WHAT given my $ = (^10).map(*.Str.flip).eager
camelia (List)
Nemokosch anyway, I don't remember needing eager in situations like that
I think it would be more idiomatic to just convert to List 12:44
RaycatWhoDat Doesn't that have the same problem?
grondilu I think I had tried that
m: say .WHAT given my $ = (^10).map(*.Str.flip).list
camelia (List)
grondilu m: say .WHAT given my @list = (^10).map(*.Str.flip); say @list[0]; say @list[0] 12:45
camelia (Array)
0
0
grondilu meh I can't even reproduce the "Seq already consumed" error. This thing is confusing. 12:46
Nemokosch Apparently it doesn't 🤔
RaycatWhoDat grondilu, I think you need to try and iterate over the same sequence twice 12:47
grondilu m: say .WHAT given my @list = (^10).map(*.Str.flip); for ^2 { .say for @list }
camelia (Array)
0
1
2
3
4
5
6
7
8
9
0
1
2
3
4
5
6
7
8
9
Nemokosch I only know that I regularly make these manipulations and never even heard of this eager thing. I know cache and this plain old List conversion
RaycatWhoDat Hm. 12:48
Maybe some operations don't consume the Seq?
grondilu my example was initially with a constant, not sure that changes anything.
Nemokosch not quite
RaycatWhoDat In that case, Nemokosch, how would you fix the code I linked above? 12:49
grondilu m: constant words = (1..100).fmt("foo%02x").words; say words[0] xx 2;
camelia (foo01 foo01)
RaycatWhoDat There's nothing sensitive in it; feel free to copy-paste
Nemokosch the @ sigil converts to positional 12:50
by default an Array iirc
so if you assign to @list, an Array will be constructed from the Seq
grondilu still can't reproduce it. oh well 12:51
RaycatWhoDat Thanks for trying, grondilu
Nemokosch by adding .List after .comb 12:52
RaycatWhoDat ohhhhhhh 12:53
Was it the `$key.comb` that was being consumed? 12:54
Nemokosch did you expect something else? 😄
RaycatWhoDat `@translations`
Nemokosch I thought we were talking about it all along
RaycatWhoDat TIL 12:55
For some reason, I thought `.comb` was eager and just left you with a new Seq each time
Never thought it was using the same iterator 12:56
Nemokosch oh no, as I said, @translations can't be consumed
it's an array by default
related thing that I don't really like: the separate concept of list assignment
so you thought it was _lazy_, right?
RaycatWhoDat Other way around
Nemokosch no, it was evaluated at the assignment and that's it 12:57
RaycatWhoDat Also, I didn't grok the implication of "oh no, as I said, @translations can't be consumed"
IIRC, you only said "the @ sigil converts to positional" 12:58
and I didn't pick up the implications from that whole thing
Nemokosch $key.comb is a function call
no call happens later on, you have that one Seq
what does that mean?
RaycatWhoDat is waiting for discord-raku-bot 12:59
Nemokosch what further implications do you need? 13:00
RaycatWhoDat No, no, I was saying that I misunderstood the implication that "@translations can't be consumed" when you mentioned that "the @ sigil converts to positional by default an Array iirc". Hence, my overall confusion but now I know. 13:01
Nemokosch anyway docs.raku.org/language/variables#i...ry-sigil_@ 13:02
RaycatWhoDat Lol. 13:03
Thank you for answering, though. I appreciate it.
grondilu looks up how to type emojis on linux 13:06
grondilu sets up typing booster
th 13:07
thinking_
Nemokosch do you have some shorthand for "ACTION" or do you just type it every single time? 😄 13:08
grondilu can now type emojis too 😁 13:10
grondilu still has to learn their names, though
moritz in IRC, you can write "/me writes" to do an action 13:18
lizmat agrees 13:19
Nemokosch 😄 13:23
patrickb o/ 13:37
patrickb I want to transfer a module (perl6-WebService-Github) to the Raku org since it's switched maintainers twice already. I guess it makes sense to rename it as well. Is there any consensus of whether there should be a "raku-" prefix in module repo names? 13:39
lizmat perhaps it should be moved to raku-community-modules ?
patrickb Is there any thing else to do except renaming the repo and transfering ownership (both via the web interface)? 13:40
oh
right
lizmat update the ecosystem ?
patrickb that's obviously the right place (in contrast to the Raku org) 13:41
Yes, I also want to do a release.
(on zef)
lizmat you have a fez login ? 13:41
patrickb Modules in raku-community-modules are still uploaded as the author that does the release (me in this case), right? 13:42
Yes I do. Already did some releases.
lizmat ok, lemme send you an invite so you can release raku-community-modules to zef 13:43
what's your fez login ?
patrickb ? 13:44
patrickb yes 13:45
lizmat invite sent
kiti_nomad[m] Does raku not support generics? 13:52
lizmat it does: 13:54
m: role A[::T] { method foo(T:D) { dd } }; A[Int].foo(42)
camelia method foo(A[Int]: Int:D, *%_)
lizmat m: role A[::T] { method foo(T:D) { dd } }; A[Str].foo(42)
camelia Type check failed in binding to parameter '<anon>'; expected Str but got Int (42)
in method foo at <tmp> line 1
in block <unit> at <tmp> line 1
patrickb Is there any preference wrt repo name prefix "raku-" vs no prefix at all? 13:56
kiti_nomad[m] Did not find enough relevant information, it is best to have covariant and inverse content
patrickb Most in raku-community-modules don't have a prefix. I think I'll just go for "WebService::GitHub" then. 13:57
Repo move in progress. 14:01
El_Che patrickb: I think the raku prefix only make sense if you the same lib for different languages on the same user root in github 14:56
*s
[Coke] I've done it when there's a p5 original mine is based on, but it's not mandatory 15:45
Geth doc: acfd787831 | rbt++ (committed using GitHub Web editor) | doc/Language/modules.pod6
Update modules.pod6

Change "perl" version in META6 to "raku" version.
16:38
doc: bc40322fd6 | (Will Coleda)++ (committed using GitHub Web editor) | doc/Language/modules.pod6
Merge pull request #4052 from rbt/patch-1

Update modules.pod6
linkable6 Link: docs.raku.org/language/modules
doc: a24a775967 | Coke++ | META6.json
update perl to raku

following best practice as described in #4052
16:44
Geth doc: JJ assigned to coke Issue Delete TODO file github.com/Raku/doc/issues/4055
JJ assigned to Altai-man Issue Delete TODO file github.com/Raku/doc/issues/4055

Adds new rule to exclude some lines
Rules for finding URLs were heuristic, and this file had a couple of examples that put URLs in some markup. This closes #4053, eliminating also skip code. All tests pass now, including that file
17:58
Geth doc: f6c1d0ece2 | Coke++ | TODO
Remove file

Closes #4055
18:47
grondilu finally managed to reproduce the error he was mentioning earlier : 19:18
m: constant words = (1..100).map: *.flip; say words.pick xx 2
camelia The iterator of this Seq is already in use/consumed by another Seq (you
might solve this by adding .cache on usages of the Seq, or by assigning
the Seq into an array)
in block <unit> at <tmp> line 1
grondilu this is quite mysterious to me, but I guess I just don't understand Seq well
especially since : 19:19
m: constant words = (1..100); say words.pick xx 2
camelia (70 71)
grondilu why would that stop working if I add a map?
m: say .WHAT for ^10, (^10).map(* * 2) 19:20
camelia (Range)
(Seq)
grondilu well ok
japhb grondilu: Assigning to an unsigiled constant means that you just want to directly store the Seq object itself in the constant, not the values that Seq would produce. 20:01
grondilu m: constant @words = (1..100).map: *.flip; say @words.pick xx 2 20:28
camelia (61 45)
grondilu japhb: noted
Tirifto Is there some straightforward way I could get a custom handle that I could both write to and read from? Basically a drop-in replacement for a handle like $*IN, except instead of getting its data from a file or STDIN, it could get them from a list or some other object in the program itself? 20:46
(If I’m getting this right, a handle does not have resources of its own, but is meant to provide access to the resources of something else; a file or a ‘stream’ by the docs. So I’m wondering if it can provide access to data I already have in the program.) 20:48
(Also, I haven’t used them much, but it feels like Supply would normally fulfill this role in Raku? Except that supplies have a different interface, and I’m wondering if I could get something that can be talked to exactly like a handle.) 20:51
tonyo Tirifto: not sure exactly what you mean by similar to a handle but raku.land/zef:tony-o/Event::Emitter might be relevant 21:02
Tirifto tonyo, thank you; probably doesn’t fit this task, but I’ll have to look into it later! 21:10
I guess that by ‘similar to a handle’ I meant I could ‘put’ stuff there and ‘get’ stuff out. Though now when I think about it, I guess any custom class implementing these methods would do? It doesn’t feel robust, but I suppose it should work if that’s all I do with them. `o` 21:11
gfldex Tirifto: Mocking IO is often used in Tests. So, you might fine inspiration in a module meant for testing.
Tirifto Well… this worked, so… yay for polymorphism! # class ToDo is Array { method get { self.shift } } 21:21
gfldex, I’ll look into that, too; thank you! 21:23
melezhik . 21:53
tellable6 2022-04-21T10:47:03Z #raku <SmokeMachine> melezhik I'll try to fix some Pg tests as soon as possible to test it, thanks!
melezhik .tell SmokeMachine - thanks
tellable6 melezhik, I'll pass your message to SmokeMachine