🦋 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 available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 8 June 2022.
00:07 reportable6 left 00:09 reportable6 joined 01:09 unicodable6 left, shareable6 left, reportable6 left, notable6 left, coverable6 left, tellable6 left, statisfiable6 left, committable6 left, sourceable6 left, linkable6 left, benchable6 left, quotable6 left, evalable6 left, bloatable6 left, squashable6 left, greppable6 left, releasable6 left, bisectable6 left, nativecallable6 left 01:10 committable6 joined, evalable6 joined, sourceable6 joined, shareable6 joined, linkable6 joined 01:11 quotable6 joined, reportable6 joined, squashable6 joined, bisectable6 joined, notable6 joined, unicodable6 joined, benchable6 joined, statisfiable6 joined, bloatable6 joined, coverable6 joined 01:12 tellable6 joined, releasable6 joined, greppable6 joined, nativecallable6 joined 01:19 deoac joined 01:53 Sgeo joined 02:06 deoac left 02:50 nort joined 03:32 frost joined 04:32 greppable6 left, statisfiable6 left, notable6 left, squashable6 left, sourceable6 left, coverable6 left, quotable6 left, linkable6 left, nativecallable6 left, tellable6 left, benchable6 left, committable6 left, shareable6 left, bisectable6 left, bloatable6 left, unicodable6 left, reportable6 left, evalable6 left, releasable6 left, shareable6 joined, releasable6 joined, evalable6 joined 04:33 squashable6 joined, greppable6 joined, nativecallable6 joined, unicodable6 joined, statisfiable6 joined, notable6 joined, committable6 joined 04:34 benchable6 joined, quotable6 joined, coverable6 joined, linkable6 joined, reportable6 joined, bloatable6 joined 04:35 sourceable6 joined, bisectable6 joined, tellable6 joined 05:35 statisfiable6 left, greppable6 left, notable6 left, bloatable6 left, committable6 left, bisectable6 left, nativecallable6 left, benchable6 left, unicodable6 left, releasable6 left, squashable6 left, evalable6 left, reportable6 left, tellable6 left, coverable6 left, shareable6 left, quotable6 left, linkable6 left, sourceable6 left, coverable6 joined 05:36 bloatable6 joined, unicodable6 joined, sourceable6 joined, evalable6 joined, squashable6 joined, quotable6 joined, greppable6 joined 05:37 benchable6 joined, nativecallable6 joined, releasable6 joined, tellable6 joined, bisectable6 joined 05:38 linkable6 joined, shareable6 joined, notable6 joined, statisfiable6 joined, reportable6 joined, committable6 joined 05:59 irc_user joined 06:06 reportable6 left 06:08 reportable6 joined
Nemokosch The uk is also missing the uk's weather 06:34
06:50 GreaseMonkey left 07:24 Sgeo left 08:09 irc_user left 09:09 linkable6 left, benchable6 left, committable6 left, nativecallable6 left, statisfiable6 left, sourceable6 left, notable6 left, coverable6 left, greppable6 left, bisectable6 left, shareable6 left, unicodable6 left, squashable6 left, evalable6 left, quotable6 left, releasable6 left, tellable6 left, bloatable6 left, releasable6 joined, shareable6 joined, sourceable6 joined, quotable6 joined 09:10 statisfiable6 joined, tellable6 joined, benchable6 joined, unicodable6 joined, nativecallable6 joined, greppable6 joined 09:11 squashable6 joined, bisectable6 joined, committable6 joined, notable6 joined, evalable6 joined, coverable6 joined 09:12 linkable6 joined, bloatable6 joined 10:40 sena_kun joined 10:55 frost left
Geth ecosystem: JRaspass++ created pull request #608:
Update a few repos from "master" to "main"
11:26
ecosystem: 10b1efa3a8 | (James Raspass)++ (committed using GitHub Web editor) | META.list
Update a few repos from "master" to "main"
11:28
ecosystem: ce7d0a2e34 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | META.list
Merge pull request #608 from JRaspass/patch-2

Update a few repos from "master" to "main"
11:30 Geth left 11:31 Geth joined 12:07 reportable6 left, reportable6 joined
[Coke] (33) wow, it's 16 here this morning. 12:23
13:07 linkable6 left, evalable6 left 13:08 linkable6 joined, evalable6 joined 13:16 jaguart joined 13:22 morte_ joined 13:49 Sgeo joined 14:00 [Coke]_ joined 14:02 [Coke] left 14:15 amenonsen left, amenonsen joined 14:30 razetime joined 14:51 waffleiron joined
waffleiron hello in raku how would i replace a backreference with the uppercase version? 14:52
lizmat $1.uc ? 14:55
waffleiron sorry i meant lowercase and .lc doesnt seem to work 14:57
i used to be able to type \l
lizmat where?
waffleiron perl -pe's/(\p{Uppercase})/\l\1/g' file 14:58
lizmat waffleiron: first off, positional captures start counting at 1 in Raku 15:00
m: say "foofoo bar".match(/ (foo) $0 /)' 15:01
camelia ===SORRY!=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> say "foofoo bar".match(/ (foo) $0 /)⏏'
expecting any of:
infix
infix stopper
postfix
statement end
lizmat m: say "foofoo bar".match(/ (foo) $0 /)
camelia 「foofoo」
0 => 「foo」
lizmat m: say "foofoo bar".subst(/ (foo) $0 /, { $0.uc }) 15:02
camelia FOO bar
lizmat m: say "foofoo bar".subst(/ (foo) $0 /, { $/.uc })
camelia FOOFOO bar
waffleiron finding this output hard to read sorry 15:03
lizmat m: say "foofoo bar".subst(/ foo /, { $/.uc })
camelia FOOfoo bar
lizmat m: say "foofoo bar".subst(/ foo /, { $/.uc }, :g)
camelia FOOFOO bar
waffleiron what is $/ 15:05
taht seems to ffix it it wont work with numbers
lizmat docs.raku.org/syntax/$$SOLIDUS
waffleiron ===SORRY!=== Error while compiling -e 15:07
Undeclared routine:
    bash used at line 1. Did you mean 'hash'?
if i use $0
lizmat without code, it's hard to tell what's going on 15:08
waffleiron perl6 -npe"s:g/(<upper>)/{$0.lc}/"  file
lizmat what does raku --version say ? 15:10
waffleiron implementing Perl 6.c. 15:11
lizmat looks like you have a pretty old version then 15:12
it should something like:
% raku --version
Welcome to Rakudo™ v2022.07-13-g10feda116.
Implementing the Raku® Programming Language v6.d.
Built on MoarVM version 2022.07.
waffleiron k
lizmat maybe get a more recent version before we go on ?
waffleiron got a newer version 15:15
raku -npe"s:g/(<upper>)/{$0.lc}/" "file"
No such method 'lc' for invocant of type 'Any'
  in code at -e line 1
  in block <unit> at -e line 1
lizmat what do you think <upper> does? 15:16
waffleiron finds an uppercase unicode letter
lizmat ok, so we're on the same page then :-) 15:17
waffleiron phew 15:18
15:18 razetime left
waffleiron i'm kind of having trouble when i try to search for things the raku way 15:21
lizmat fwiw, I'm not a regular user of -np :-) 15:22
waffleiron well i just started to use it i sort of accidently used perl5 but i really wanted to use perl6 15:23
lizmat well, it's called Raku nowadays :-) 15:24
raku -npe '$_ .= subst("e","a",:g)' file
so... 15:25
waffleiron i get load of potteryh when i search raku :P
Nemokosch as they say: search friendly attempt is to always add "lang" 15:26
15:26 razetime joined
lizmat raku -npe '$_ .= subst(/ <upper> /, { $/.lc },:g)' file 15:26
waffleiron sec
i wanted it to work using capture groups 15:27
Nemokosch golang, rakulang, redlang etc
~~erlang~~
lizmat why ? 15:28
waffleiron try searching for raku books on ebay and you'll see what i mean
lizmat "raku programming language" and rakulang should give you better results 15:29
Nemokosch I'm not surprised if you eventually won't find many books on ebay, though...
lizmat raku -npe 's:g/ <upper>+ /{ $/.lc }/' 15:30
waffleiron: so, why do you want to use backrefs ? 15:31
15:31 morte_ left
lizmat raku -npe 's:g/ (<upper>+) /{ $0.lc }/' Changes 15:31
Nemokosch doesn't p override n by the way
waffleiron a i want to know how to do it B i've done it before in previous languages 3 . I don't have a specific reason
like if i've done it before maybe i think i can be usefull again 15:32
at i'm just testing and learning
atm
lizmat ok :-) 15:33
waffleiron I've kind of used regexes quite alot before as well ( i probally suck at them) 15:34
lizmat well, fwiw I don't like -np in Raku much, as it is too much like Perl's 15:35
I guess it was one of the first features implemented way back when
waffleiron yeah i tried to search for launch options i did'nt seem to find the info 15:36
lizmat raku -h
waffleiron btw your code works any idea why it didnt work before? 15:40
the plus makes it work i guess 15:41
nope
Nemokosch still, pretty please 🥺 15:42
confirm or deny pls
I think p is just n with an additional ".say"
lizmat yup
waffleiron the n option is that not neeeded if you have a loop in the code?
lizmat -e will just run your code once 15:43
15:44 discord-raku-bot left
waffleiron i ask becasue i was messing around pipeing input from standard input and one the options didn't have -n but still went through the input 15:44
15:44 discord-raku-bot joined
Nemokosch the p option also gives you the loop iirc 15:44
waffleiron anyways ty i now know i should use single quotes and not double quotes when using regex 15:46
it seems that was the problem i thought i needed double quotes when using inline code 15:47
Nemokosch why? 🙂
lizmat waffleiron: i think it was the shell messing up there
waffleiron ah ok maybe
lizmat you *can* use single quotes, but when used in a shell, the shell messes up
well, fsvo messing up :-)
Nemokosch probably 15:48
waffleiron i'm probally doding things all wrong there always seems to be a million ways to do things 15:50
wrong things
15:50 discord-raku-bot left, discord-raku-bot joined
lizmat waffleiron: fwiw, I learned a few things about -n -p in Raku today :-) 15:54
waffleiron cool :)
Nemokosch so we have || slipping on Hashes in the 6.e preview 16:08
what happens - better asked: what should happen - if the thing to slip by, is empty?
waffleiron (as a person who know nothing about raku) could you not do either by setting some sort of option? 16:10
and let people choose
anyways thanks for all your help everone 16:23
16:24 waffleiron left 16:32 sena_kun left 16:41 deoac joined
Nemokosch I wish there was //:= as well :DD 16:42
deoac When using the `Test` module, how do I test the output to `$*OUT`? 16:43
16:43 ajr joined
lizmat deoac: raku.land may have some modules 17:03
17:03 a3r0_ left
lizmat personally I'd use Trap for its simplicity 17:03
m: raku.land/zef:lizmat/Trap
camelia ===SORRY!=== Error while compiling <tmp>
Confused
at <tmp>:1
------> https:⏏//raku.land/zef:lizmat/Trap
expecting any of:
colon pair
lizmat raku.land/zef:lizmat/Trap 17:04
rather :-)
17:04 a3r0 joined
lizmat or maybe silently: raku.land/zef:lizmat/silently 17:04
17:09 atroxaper joined
leont still has to finish their presentation, but this heat is melting their brain 17:13
lizmat well, you're theb first on Sunday... so maybe still a little time 17:16
17:22 razetime left 17:53 Xplorator joined 18:06 reportable6 left 18:07 reportable6 joined 18:19 Xplorator left 18:20 ProperNoun left 18:29 [Coke]_ is now known as [Coke] 18:55 atroxaper left 19:48 p6steve joined
p6steve m: role R { method new {say 'yo'}}; my $x = 42 but R; 19:48
camelia ( no output )
p6steve ^^^ wonders why new() or TWEAK() don't fire on a mixin? 19:49
deoac Thanks, lizmat.  `Trap` is *exactly* what I need for testing. 20:05
I wonder why there's nothing similar in `Test` . 20:06
lizmat well, maybe Trap will make it into core at some point :-)
p6steve is there a way to constrain $x to eg. defined from the mixin R? 20:10
SmokeMachine m: role R { say 'yo' }; my $x = 42 but R;  20:18
camelia yo
SmokeMachine m: role R { method COMPOSE { say 'yo' } }; my $x = 42 but R; # COMPOSE still doesn’t to it, does it? 20:20
camelia ( no output )
20:20 discord-raku-bot left, discord-raku-bot joined
p6steve ^^^ wonders why new() or TWEAK() don't fire on a mixin? 20:24
oops
20:25 sena_kun joined
p6steve m: role R { say self }; my $x = 42 but R; 20:29
camelia ===SORRY!=== Error while compiling <tmp>
'self' used where no object is available
at <tmp>:1
------> role R { say ⏏self }; my $x = 42 but R;
expecting any of:
argument list
term
p6steve ^^^ not getting it ... I would like the mixin to be able to get the invocant and test it for definedness when "constructed" 20:30
lizmat there's only an invocant inside a method 20:33
m: role R { method foo() { say self } }; my $x = 42 but R; $x.foo 20:34
camelia 42
p6steve yeah but (see 20:48 above) there's no method new on mixing in afaict 20:35
is there a method that gets called on mixin "construction"
?
Geth ecosystem: JRaspass++ created pull request #609:
Update Ed25519 URL
20:42
ecosystem: ab4a9ba3a8 | (James Raspass)++ (committed using GitHub Web editor) | META.list
Update Ed25519 URL (#609)

The repo has changed to from "Ed25519" to "ed25519-raku" and the default branch from "master" to "main".
20:50
21:25 evalable6 left 21:28 evalable6 joined 21:41 sena_kun left 21:42 sena_kun left 21:51 pamplemousse joined 22:11 Xplorator joined
Xplorator Hi. Is normal that the following regex cause a parse error? 22:12
m: say "abcabc" ~~ / ^ <before ("abc")> /' 22:13
camelia ===SORRY!=== Error while compiling <tmp>
Unable to parse expression in metachar:sym<( )>; couldn't find final ')' (corresponding starter was at line 1)
at <tmp>:1
------> say "abcabc" ~~ / ^ <before ("abc")>⏏ /'
expecting an…
Nemokosch not sure one is allowed to put a capture group inside a lookaround 22:22
I for one wouldn't allow it, that's for sure 😅
since lookarounds are parts that wouldn't belong to the matching - if you actually do want to match them, why not just... match them? 22:23
22:28 pamplemousse left
Xplorator It seems that we ARE allowed to put capture in "lookarounds" though 22:30
m: say "abcde" ~~ / (a) <()> (b) /
camelia 「」
0 => 「a」
1 => 「b」
Xplorator but maybe the "<(" and ")>" forms of lookarounds are exceptions 22:32
Also, what bugs me is not really the ability or inability to put 22:34
capturing groups inside <before> <after> lookarounds
What bugs me is that is we are can put them unless they are the top level thing 22:36
This is allowed for example say "abcabc" ~~ / ^ <before ("abc")**2> /
guifa_ <( isn't a lookaroundl, they're just start/end anchors 22:39
Xplorator right, thanks for the clarification
guifa_ Re before and after, you CAN do a capture group, but there is no way to access before/after outside of the before/after match, as the before/after isn't actually stored. Curiously, their existance is noted in gisting a Match 22:44
m: say 'ab' ~~ /<after a> b/;
camelia 「b」
after => 「」
Xplorator they disappear when we do <.before> / <.after> 22:45
I didn't express my self correctly
the troubling thing is that the error message says 22:46
Unable to parse expression in metachar:sym<( )>; couldn't find final ')'
while the matching right brace is clearly present 22:47
guifa_ some metachar:sym<( )> are parentheses 22:57
not <( and )>
the issue is you just need a space
m: say "abcabc" ~~ / ^ <before ("abc" )> /'
camelia ===SORRY!=== Error while compiling <tmp>
Unable to parse expression in metachar:sym<( )>; couldn't find final ')' (corresponding starter was at line 1)
at <tmp>:1
------> say "abcabc" ~~ / ^ <before ("abc" )>⏏ /'
expecting a…
guifa_ err
m: say "abcabc" ~~ / ^ <before ("abc") > /'
camelia ===SORRY!=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> say "abcabc" ~~ / ^ <before ("abc") > /⏏'
expecting any of:
infix
infix stopper
postfix
statement end
guifa_ m: say "abcabc" ~~ / ^ <before ("abc") > / 22:58
camelia 「」
before => 「」
guifa_ there we go
)> is a term in the grammar since it's just an anchor of sorts, so the parser treats it as a single entity (no different than $ or ^ )
before (capture-group-start-token), (a), (b), (c), (end-match-anchor) ………… and then reaches the end of the string without finding the capture-group-end-token 23:01
Xplorator Oh right I see
thanks
I guess this was a longest token matching thing. A lexing problem
guifa_ Yeah. Consider * vs ** 23:02
5 * * ---> anon sub :: ($x) { 5 * x }
but 5 ** is "five to the power of… wait what?" 23:03
Xplorator yes it it definitely the same sort of error 23:04
could it be a new case for less than awesome error messages? 23:05
Nemokosch from the user's perspective, definitely... 23:10
guifa_ It might be tough though, because you'd need to check over ever symbol with tighter precedence that starts with the expected end symbol. Not sure how easily that can be done, since it'd cover infixes, postfixes, prefixes, terms, etc 23:13
23:28 linkable6 left, evalable6 left 23:29 linkable6 joined 23:31 evalable6 joined 23:34 pamplemousse joined 23:42 pamplemousse left 23:50 Xplorator left