🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). 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 6 September 2022.
tbrowder wayland76: i'm very interested in your pod quest. if you are using some published module that extracts the pod nodes in an array of objects that **clearly** define pod **type**, **contents**, and any **children**, i would like to know its name. my problem with parsing $=pod has always been the recursive nature of pod nodes and having to recurse to the end before knowing how to handle a conversion to a PDF file. thanks for any 12:45
suggestions.
tellable6 tbrowder, I'll pass your message to wayland76
tbrowder my only idea to handle the situation is using arrays to push to until the end and then replay from the begining knowing more about the structure. 12:48
*beginning 12:50
afk& 12:54
[Coke] tbrowder: have you tried using the RakuAST parser instead? 13:14
github.com/Raku/doc/blob/main/xt/r...e.rakutest goes that route 13:16
tbrowder [Coke]: no, but thanks: that’s a good idea, you may have mentioned that before…and i forgot it ☹️ 15:58
…just looked…wow, i’m gonna use it very soon!! 16:01
i just emailed the link to myself…with a TODO label—exciting! 16:04
[Coke] wow, glad to hear. :) 19:25
I was very happy to start switching the raku/doc testing over to that instead of the original parser.
And I was able to combine 3-4 tests into a single test, making everything even faster. 19:26
Xliff Hi Lowe! 21:46
Or would "Hifi, Lofi" be a better alternative? 21:47
I need to build a native call sub definition at runtime. Can anyone point me to prior art or a code snippet? 21:48
Mainly because I won't know the .so filename until then.
Hmmm... Odd. I think I've built this right like so... 22:06
Xliff m: my &gst_spectrum_get_type = sub { * }; trait_mod:<is>(&gst_spectrum_get_type, native => "/usr/local/lib/x86_64-linux-gnu/gstreamer-1.0/libgstspectrum.so"); trait_mod:<is>(&gst_spectrum_get_type, symbol => "gst_spectrum_get_type"); 22:06
camelia Use of Nil in string context
in block <unit> at <tmp> line 1
Use of Nil in string context
in block <unit> at <tmp> line 1
Can't use unknown trait 'is' -> 'native' in sub declaration.
in block <unit> at <tmp> line 1
Xliff m: use NativeCall; my &gst_spectrum_get_type = sub { * }; trait_mod:<is>(&gst_spectrum_get_type, native => "/usr/local/lib/x86_64-linux-gnu/gstreamer-1.0/libgstspectrum.so"); trait_mod:<is>(&gst_spectrum_get_type, symbol => "gst_spectrum_get_type"); 22:07
camelia ( no output )
Xliff However I get the following when I run it:
Cannot locate symbol 'gst_spectrum_get_type' in native library '/usr/local/lib/x86_64-linux-gnu/gstreamer-1.0/libgstspectrum.so'
Even though I get the following from readelf:
54: 0000000000004a20 89 FUNC LOCAL DEFAULT 14 gst_spectrum_get_type 22:08
timo Xliff: i think you can't use dlopen for "LOCAL" symbols 23:47
something fun i found today:
m: my Channel $updates .=new; start { react { whenever $updates { .say; LAST { say "update channel closed" } } } }; say "updates done hooray!" }; for ^ 10 { sleep 0.05; $updates.send(($ = "a")++); }; say "finished"; $updates.close; 23:50
camelia ===SORRY!=== Error while compiling <tmp>
Unexpected closing bracket
at <tmp>:1
------> ed" } } } }; say "updates done hooray!" ⏏}; for ^ 10 { sleep 0.05; $updates.send(
timo m: my Channel $updates .=new; start { react { whenever $updates { .say; LAST { say "update channel closed" } } }; say "updates done hooray!" }; for ^ 10 { sleep 0.05; $updates.send(($ = "a")++); }; say "finished"; $updates.close;
camelia a
a
a
a
a
a
a
a
a
a
finished
timo m: my Channel $updates .=new; my $ will leave { await $_ } = start { react { whenever $updates { .say; LAST { say "update channel closed" } } }; say "updates done hooray!" }; for ^ 10 { sleep 0.05; $updates.send(($ = "a")++); }; say "finished"; $updates.close;
camelia a
a
a
a
a
a
a
a
a
a
finished
update channel closed
updates done hooray!
timo ^- you can put the "await" in an anonymous variable's leave phaser so you don't have to keep it in a variable and put an explicit LEAVE block that refers to it, or to put an await at the end of your block (and take care if you use the last-statement-return-value semantics for something) 23:53