9 Jul 2024
antononcube @_grenzo Well, I do the latter for my DSLs/ 21:50
I think this is one of the best, most unique features of Raku -- using OOP for grammars. 21:52
Actually, I was wondering / experimenting last year using EBNF and Functional Parsers (FP) instead of grammars. (In Raku.) But I quit EBNF/FP after I saw Raku's handking of gramamrs.
@_grenzo I think a year or two ago I found this interview with D. Conway, where he discusses grammars and OOP: mappingthejourney.com/single-post/...-language/ 21:56
10 Jul 2024
_grenzo That actually helped and I chose to use roles...which seem to be working well 15:55
12 Jul 2024
cioran Hey! Is there more GUI stuff for raku or perl5? Kind of confused havent used perl in years. Have to use something in perl that works great wanto to do a GUI for a cmd line software for some colleagues 17:54
lizmat something like raku.land/zef:japhb/Terminal::Widgets ? 17:57
cioran Nice! 18:03
Thx bookmarking
antononcube Well, TUI is not GUI. 18:33
Are considering making a GUI app with Raku? 18:35
cioran Nevermind I think I got it sorted, doing tk w/perl thx guys
14 Jul 2024
thowe the docs don't seem to cover this, so what does a "g" mean in a regex? Like when I see something like m:g/\d/ 21:43
lizmat :g is short for :global 21:46
m: say "1234" ~~ m/ \d / 21:47
camelia 「1」
lizmat m: say "1234" ~~ m:g/ \d /
camelia (「1」 「2」 「3」 「4」)
lizmat aka, return all possible matches
librasteve thowe: this is the best doc for raku regex imo ... docs.raku.org/language/regexes#Common_adverbs 21:49
thowe Ah, I see global in a different location... Doesn't help me solve my issue though. Red herring. Proc::Async must be where I need to look.
librasteve yeah - raku moved the adverbs from perl re (since they are just now regular raku adverbs ;-)) 21:50
thowe I suspect Proc::Async.stdout.tap doesn't have a way to specify that it should split on newlines the way $proc.stdout.lines does. 21:53
With tap you can get the output in a variable like so "$supply.tap(-> $v { say "$v" });" but I can't seem to figure out how to use a variable other than $_ when doing "react { whenever $proc.stdout.lines {" 22:16
how would I get lines in $line? 22:17
for example
looking at docs.raku.org/type/Proc/Async
librasteve thowe: it would be very helpful to see you code alternatives in a gist or similar 22:18
thowe Well, the documentation itself shows a good example of what I mean... The first example shows "$proc.stdout.lines" and then the line is in $_. The second example, "Proc::Async without using a react block:", shows $proc.stdout.tap creating "$v". 22:23
How would I do the equiv of creating "$v" with the lines method?
Might be a moot point as I can't get a react block to actually do anything. 22:30
here's both versions in one snippet: gitlab.com/-/snippets/3728658 22:35
The problem with tap, is that the lines I am getting from my maillog will be broken up, and so I can't rely on having an actual line to parse. 22:36
My problems with the lines/react method are legion. How do you make your program do anything else other than the react loop? How do you get the line as a variable you name like with tap? Oh, yeah, also, why does it not actually seem to get any data ever... 22:38
tap seems to work until I get a half line, and then the other half of the line as another line.
I got this from an example in the book "Raku Recipes" but it doesn't really work. 22:39
recipe 2-3
I'm sure most of my confusion is just not understanding reactive programs or supplies or whatever, but the question about assigning a variable to lines remains 22:46
I'm really getting lost in the weeds here, though. What I would really like is to know how to get tap to take the lines as they are given and not break them up. 22:48
so, trying to do something where I assemble the lines.. 23:34
ab5tract When creating a block, you can specify a signature. This allows you to name the parameter and reference it by that name in the block 23:35
m: (-> $param { dd :$param })(42) 23:36
camelia :param(42)
ab5tract This works also for if
m: my %h = :k(‘v’); if %h<k> -> $value { dd :$value } 23:38
camelia :value("v")
ab5tract Or anywhere that a block can fit 23:39
The reason the react block doesn’t get any data is because you have to call start on the proc sync object 23:43
You can have this happen in your react block or assign the start promise into a variable before the react block is defined 23:44
docs.raku.org/type/Proc/Async 23:45
15 Jul 2024
thowe I need more testing but I appear to have a version that can assemble lines as they come in disjointed. 00:34
OK. This is the version using tap that can do line reassembly. feel free to tell me how to be more idomatic. gitlab.com/-/snippets/3728669 00:41
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2024/07/15/2024-...exprjit-5/ 15:48