🦋 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.
Geth App-Rakubrew: 73055cc269 | (Patrick Böker)++ | 2 files
Fix version switching which broke in the previous release
08:11
App-Rakubrew: 5db0e5d4a5 | (Patrick Böker)++ | 3 files
Version 21
xinming For a grammar, How can we get all the match? 08:36
lizmat doesn't $/ contain a tree of all matches ? 08:54
user51 where can i find information about the whys behind raku? i'm specifically interested in the grammars and lazy evaluation 08:56
Skarsnik It's probably in the apocalypse (or whatever the name of the draft documents for Perl 6) 09:02
lizmat design.raku.org
SmokeMachine can anyone reproduce [this](github.com/rakudo/rakudo/issues/3959)? 09:06
Altreus markdown support in IRC when? 09:07
:D
xinming lizmat: I use my $match = MyGrammar.subparse($str); <--- It'll return the first matched result. 09:10
Skarsnik thanks lizmat :)
Altreus SmokeMachine: running your last comment in a fairly large dir and not seeing the issue 09:13
not hitting symlinks are you?
oh wait 09:14
... not oh wait, I thought it wasn't running but it is :D
SmokeMachine: oh! I got one!
SmokeMachine Altreus: It takes som tries...
*some 09:15
Altreus there's nothing special about the file either
SmokeMachine and, at least for me, the file giving the problem keeps changing... 09:16
Altreus I can reproduce it but I can't offer any further insights
SmokeMachine Altreus: Thanks, I just wanted to be sure that's not specific to my environment. 09:17
Altreus added a comment :) 09:19
SmokeMachine xinming: would `my $match = MyGrammar.parse($str);` do what you want?
Altreus: thanks!
xinming SmokeMachine: Nope, the Grammar.parse will need the whole string to match the grammar, But I want to extract only all interesting parts out of a string. 09:22
Altreus looks like I can get at least one file to go wrong each time through 09:30
SmokeMachine: does it only happen async?
lizmat abs2rel depends on $*SPEC, I wonder whether there's a race condition in start on dynamic var lookup somehow 09:31
SmokeMachine Altreus: I couldn't get it sync... 09:32
El_Che weekly: rakudo-pkgs up 09:33
notable6 El_Che, Noted! (weekly)
SmokeMachine lizmat: $*SPEC? I was trying to see if $*CWD was different on those errors... 09:34
lizmat that could also be the case 09:35
an IO path has both a local copy of $*CWD and $*SPEC on creation by default
El_Che: liz@DebianMini:~$ raku -v Welcome to 𝐑𝐚𝐤𝐮𝐝𝐨™ v2021.09. :-) 09:36
El_Che :) 09:40
raydiak xinming: grammars aren't really meant to be used like that, a somewhat cleaner solution would be to change your TOP rule to accept strings of .*? between the relevant parts. that said, you could messily kinda force what you want like this: 09:49
m: grammar G { our token TOP { . } }; say "foo" ~~ m:g/<{G::<&TOP>}>/
camelia (「f」 「o」 「o」)
raydiak seriously though, restructuring your TOP rule something like this would be a step up from that nonsense: 10:04
m: grammar G { regex TOP { .*? <relevant>+ %% .*? }; token relevant { \w } }; say G.parse(" f o o ")<relevant>
camelia [「f」 「o」 「o」]
xinming raydiak: thanks for the example. :-) 11:02
Altreus SmokeMachine: I did « my $a = .relative ~ " $*CWD"; » and $*CWD was correct by the time it was evaluated 11:08
but .relative still contained a ..
I noticed also that you included .relative *again* in the die and it had become correct by then 11:10
SmokeMachine I've been running this with no luck: www.irccloud.com/pastebin/4KayT48W/ 12:36
raydiak xinming: you're welcome, glad I could help. :) someone backlogging in the next several hours might have a cleaner approach, but some approximation of those two are the only I can think of 12:38
sleep & 12:39
Altreus SmokeMachine: The implication is that evaluating $*CWD is always correct, and so maybe .relative doesn't use that but something underneath it 12:42
that is, maybe accessing $*CWD forces a sync or something, which .relative doesn't trigger
but hang on, why would .relative think the file is in ..
it would have to believe cwd is ./something 12:43
ugexe im pretty sure ive seen that .relative bug in bug reports to zef before fwiw, but i never knew it had been golfed and reported to rakudo 12:47
SmokeMachine Altreus: yes, that's why I thought $*CWD should be something different on the error cases... 12:50
Altreus hmm 12:52
I'm getting it to die if $*CWD is ever not my homedir, hard-coded 12:53
I expect it not to 12:54
yeah no dying 12:56
must be something that's not leaking out to the user level
[Coke] can we track github wiki changes with a bot? 13:59
lizmat I think changes are pushed to a webhook, yes 14:05
jdv y u want a firehose? 14:09
looks like its called a "GollumEvent" 14:13
[Coke] We don't update the rakudo/nqp/moarvm wikis often, actually 14:24
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2021/09/20/2021-...-feedback/ 14:36
Anton Antonov I am looking for ways to use a Java JAR file (the classes in it) within a Raku program. I did not succeed finding a module are discussion about that. Any pointers? Should I look into Perl5 modules for that? 14:42
MasterDuke Anton Antonov: i assume you mean using rakudo running on the jvm backend? i don't think that's possible, but bartolin_ would be a good person to ask 14:49
Anton Antonov: i just asked jonathan worthingon your question and he said "I thought something like that was implemented, but it's been years since I looked, so I've really no idea." 14:54
the jvm backend hasn't had a whole lot of development recently, you might try searching for older perl 6 blog posts 14:55
Anton Antonov #MasterDuke Thank you for response! I have to say, I am looking for any possible solution, e.g. (1) using JVM backend, (2) connecting to a Java server, or (3) using "native call" or something. From your answers -- at this point -- I will simply not look for using/connecting to Java from Raku. 15:18
MasterDuke github.com/rakudo/rakudo/blob/mast...terop.java looks like maybe something is possible? 15:22
Anton Antonov @MasterDuke -- yes, very promising! 🙂 This "old" discussion is what I found: stackoverflow.com/q/27156329 . 15:35
MasterDuke cool 15:36
user51 skaji: lizmat: thanks! 15:40
skaji: sorry, i meant skarsnik, seems like they left 15:41
xinming in .grep(...) Is there shorter way to write something like, .grep(* !~~ /^ \s+ '#' /); ?? 16:10
it's just use negative value of regex 16:11
Altreus according to the doc 16:15
say <a b c d e f>.grep(none /<[aeiou]>/); # OUTPUT: «(b c d f)␤»
not that one
say <a b c d e f>.grep({! /<[aeiou]>/}) # OUTPUT: «(b c d f)␤»
that one
but also the first one, I suppose!
xinming Got it, thanks. 16:42
gabriel80546 Have you ever wanted to run raku on your phone? well that is totally possible. 19:48
the great guy named Max Kapusta on stackoverflow have figured that out.
all you need is to use the app UserLand and install rakudo with `sudo apt install rakudo`
stackoverflow.com/questions/690910...1#69247911
xinming I used that, but it's not the newest version of raku 19:56
hmm, Maybe my info is outdated, I tried it at the beginning of this year.
xinming I'll try userland the other day. ;-) 20:01
gabriel80546 try it. it really works 20:02