🦋 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.
grondilu m: my Blob $ but role {} 00:02
camelia No such method 'mixin' for invocant of type
'Perl6::Metamodel::ParametricRoleGroupHOW'
in block <unit> at <tmp> line 1
grondilu can't I mix a role to a Blob?
m: my Str $ but role {}
camelia ( no output )
grondilu m: .talk() given my Str $ but role { method talk { say "hi"; } } 00:04
camelia hi
grondilu m: .talk() given my Blob $ but role { method talk { say "hi"; } }
camelia No such method 'mixin' for invocant of type
'Perl6::Metamodel::ParametricRoleGroupHOW'
in block <unit> at <tmp> line 1
grondilu m: my blob8 $x .= new: 5; say $x but role {} 00:06
camelia This REPR cannot change type
in block <unit> at <tmp> line 1
Voldenet the `no such method mixin` is caused by trying to add mixin to a role 00:12
m: my Stringy $ but role {}
camelia No such method 'mixin' for invocant of type
'Perl6::Metamodel::ParametricRoleGroupHOW'
in block <unit> at <tmp> line 1
grondilu what about when I try with an actual instance, then? The 'REPR cannot change type' error above? 00:14
m: my blob8 $x .= new: 5; say $x.?WHAT 00:15
camelia ===SORRY!=== Error while compiling <tmp>
Cannot use .? on a non-identifier method call
at <tmp>:1
------> my blob8 $x .= new: 5; say $x.?WHAT⏏<EOL>
expecting any of:
method arguments
grondilu ah sorry
m: my blob8 $x .= new: 5; say $x.WHAT
camelia (Blob[uint8])
grondilu FYI I wanted to use a Blob as a crypto key so I wanted to add methods such as "sign", "verify" and so on. 00:17
Voldenet Blob is repr('VMArray') 00:18
m: class {}.new but role {}
camelia ( no output )
Voldenet m: class :: is repr('VMArray') {}.new but role {}
camelia This REPR cannot change type
in block <unit> at <tmp> line 1
grondilu ok. Is this specced or could it change in the future? 00:19
oh now I seem to recall that native types can not be mixed. I had seen that with native integers long ago. 00:21
grondilu I suppose the same is true with blobs. 00:21
Voldenet it appears that repr things can't be mixed in, but nothing in Blob says it can't
I'm speculating that it might be changed in the future for consistency 00:25
grondilu noted 00:26
Voldenet but it's my pure guess 00:28
based on how there's nothing regarding this in docs (in fact, only Buf and utf8 are repr('VMArray') according to docs) 00:37
grondilu yeah after all isn't Blob supposed to be to blob, buf and so on what Int is to native integers? The upper case marking the non-repr type or something? 00:46
m: my uint $
camelia ( no output )
grondilu m: my uint $ but role {}
camelia ( no output )
grondilu oh my bad, I thought that would fail 00:47
grondilu so we can mix roles to natives after all 00:47
m: .talk() given my int $ = 57 but role { method talk { say "hi"; } } 00:48
camelia No such method 'talk' for invocant of type 'Int'. Did you mean any of
these: 'WALK', 'all', 'tail', 'take', 'tan', 'tanh', 'tclc'?
in block <unit> at <tmp> line 1
grondilu m: .talk() given my int $ but role { method talk { say "hi"; } }
camelia hi
grondilu m: .talk() given (my int $ = 57) but role { method talk { say "hi"; } }
camelia hi
grondilu m: say (my int $).WHAT 00:49
camelia (Int)
grondilu m: say (my int $ = pi).WHAT
camelia This type cannot unbox to a native integer: P6opaque, Num
in block <unit> at <tmp> line 1
grondilu m: say (my int $ = 3).WHAT 00:50
camelia (Int)
grondilu m: say (my int32 $ = 3).WHAT
camelia (Int)
grondilu meh 00:51
grondilu first draft at Ed25519 in raku : gist.github.com/grondilu/2b6f4f0ba...4ca0dfcc93 01:23
I will make a proper module availabe someday. 01:24
SmokeMachine as I said yesterday, I'm adding something like subset to Red like the picture. But I really would like use real subset for that... any idea of how? Will I have to wait for RakuAST? usercontent.irccloud-cdn.com/file/.../image.png 02:43
Xliff SmokeMachine: Why not "subset Admin where *.role eq 'admin'" ? 04:54
SmokeMachine Xliff: that’s what I want, but that would only work for comparing that, and not for the .^all. I needed a custom SubsetHOW for that. Is there a way of using `subset Admin of User where *.role eq “admin”` to use a custom SubsetHOW? 08:24
It would be great if the refinee could say what SubsetHOW to use… 08:29
nine grondilu: why not something like class CryptoKey { has blob8 !key handles <sign verify ...> ; }? 10:45
nine grondiluÖ or rather class CryptoKey { has blob8 !key handles <whatever blob methods you want to support>; method sign(...) { ... }; method verify(...) { ... } }? 10:47
crab46 Hi 11:22
Nemokosch Suppers 11:57
SmokeMachine m: gist.github.com/FCO/89df04517cee86...25cc2e12ee 12:03
camelia ( no output )
SmokeMachine m: gist.github.com/FCO/89df04517cee86...25cc2e12ee 12:04
camelia ===SORRY!=== Error while compiling <tmp>
Could not find CustomSubset in:
inst#/home/camelia/.raku
inst#/home/camelia/rakudo-m-inst-1/share/perl6/site
inst#/home/camelia/rakudo-m-inst-1/share/perl6/vendor
inst#/home/came…
SmokeMachine this gist.github.com/FCO/89df04517cee86...25cc2e12ee is giving me `===SORRY!===\nRequired named parameter 'refinee' not passed` am I doing something wrong I testing using the default SubsetHOW, but my intent is to use a custom one. Both are giving me the same error 12:07
SmokeMachine my intent is to do something like this gist.github.com/FCO/415e4de3ac20fb...93af59a254 12:14
this already works: usercontent.irccloud-cdn.com/file/.../image.png 12:15
Xliff gist.github.com/Xliff/25c4b333080e...1e5cb5bd2a 15:09
p6steve Xliff: nice! btw I also have Lat & Long in Physics::Navigation ... would be happy to adjust so we play nice (I have been meaning to add support for Google Maps latlong too at some point 15:12
)
Xliff p6steve: Well, near as I can tell it shouoldn't be too hard. 15:22
GWeather works in degrees.
But there are helper funcs in the lib to facilitate conversion to radians.
p6steve: Nice work on the Physics Modules, btw! 15:23
bengur Hi, just so you know, I tried to install rakudo-star-2022.03 from source on a debian system and had to replace version numbers 2022.02 by 2022.03 in etc/fetch_core.txt or it would fail. 15:33
ramiroencinas Hi! In the grammars context I need to use a token to match a string with length lower or equal than 5 chars for example. If I use the quantifier ** like in `token tok { \w ** 5 };` and the input is 'aaaaaa' the match is true in the grammar. I need to specify the max chars to match in this token. Is possible? Thanks for the help! 15:57
SmokeMachine m: say $_ ~~ / \w ** 0..5 / for <<aaaaa aaaa aaa aa a "" aaaaaa>> 16:00
camelia 「aaaaa」
「aaaa」
「aaa」
「aa」
「a」
「」
「aaaaa」
SmokeMachine m: say $_ ~~ /^ \w ** 0..5 $/ for <<aaaaa aaaa aaa aa a "" aaaaaa>>
camelia 「aaaaa」
「aaaa」
「aaa」
「aa」
「a」
「」
Nil
ramiroencinas Thanks SmokeMachine, my token tok { ^ \w ** 1..5 $ }; works like a charm. 16:06
p6steve Xliff: thanks - for me it was a fun way to ramp back up after 10 years afk! ... 16:31
lichtkind sorry for inconvenience i pushe wrong butten but deleted wrongly forked repo on raku modules
sorry for inconvenience i pushe wrong butten but deleted wrongly forked repo on raku modules 16:32
lizmat lichtkind: which repo? 16:40
Xliff p6steve: Haha! True that. My p6-GLib suite is some 660k lines of Raku over 30-ish projects! 16:45
lizmat Xliff: I did some work on optimizing grammar Actions yesterday: I'd appreciate if you could run a timing again and see if that made a difference. I hope to see 1-2% improvement 16:55
lichtkind lizmat: hai liz i becasme maintainer of the p5 module chart and i just wanted check who forked it and i misunderstood the display of the orgs im in with the ones who forked it so instead looking why raku modules org forked the p5 module i just created it, , but its deleted now 16:57
lizmat ah, ok...no worries then :-)
lucs Doing 「use IO::String; say IO::String.new.raku」, I get 「IO::String.new(nl-in => Any, nl-out => Any, nl-in => $["\n", "\r\n"], nl-out => "\n", …)」. 18:18
How is it that there are duplicate attributes? (nl-in and nl-out)?
lizmat feels like a problem in the implementation of IO::String.raku ? 18:20
lucs Could be I suppose, but how does one ever get that (duplicate attrs.)? 18:21
Oh, wait, you mean IO::String may have its own implementatin of raku()? 18:22
lizmat perhaps... yes 18:23
lucs Hmm...
Doesn't appear to, but it has 「class IO::String:ver… is IO::Handle { … }」, so maybe there... 18:25
thosAnyway, I just realized I was invoking one of its methods wrongly, so now my code is working, and figuring out those duplicates is not so interesting anymore :) 18:30
s/^thos//
"my code is working": famous last words :-( 18:46
gfldex my code is working¹ 18:47
¹) right now
:) 18:48
lucs Yeah, something like that ;)
neither hi how can I match against any type a package provides: there are `Pack::Age::Cls`, `Pack::Age::Cls::Int32`, `Pack::Age::Cls::Int64`, `Pack::Age::Cls::Float32` etc. I try to check if `$var` is of any of these types? i.e., does it come from `Pack::Age::Cls` family 19:36
there is no inheritance relation going on by the way 19:37
moritz give them a common marker role, like Pack::Age::Cls::Type, and then check against that role 20:18
neither thanks but I don't control their code 20:23
moritz then any(type1, type2, type3, ...) 21:16
Geth problem-solving/docs-website: 8b951c04cb | (Daniel Sockwell)++ | solutions/documentation/new-documentation-frontends.md
Solution for Raku/doc/issues/1246

This PR proposes a solution to Raku/doc/issues/1246. (I now realize that issue was in the doc repo rather than the problem-solving one and thus _technically_ I should open an issue in this repo and discuss the matter here before opening a PR. Since that issue has been active for 5 years and has generated the a similar discussion as it would have as ... (12 more lines)
problem-solving: codesections++ created pull request #320:
Solution for Raku/doc/issues/1246
21:19
Geth problem-solving/docs-website: 2147c097b0 | (Daniel Sockwell)++ | solutions/documentation/new-documentation-frontends.md
fix typo
21:27
grondilu Isn't there such a thing as a parametrized module? I've tried with a role but failed : 22:44
m: role Foo[$foo] { sub talk is export { say "$foo" } }; import Foo["hi"]; talk 22:45
camelia ===SORRY!=== Error while compiling <tmp>
Undeclared routine:
talk used at line 1
grondilu m: module Foo { sub talk is export { say "hi" } }; import Foo; talk 22:46
camelia hi