This channel is intended for people just starting with the Raku Programming Language (raku.org). Logs are available at irclogs.raku.org/raku-beginner/live.html
Set by lizmat on 8 June 2022.
07:23 MasterDuke left 08:13 dakkar joined 09:01 flyin_to_ether joined 09:02 flyin_to_ether left 14:03 xkoncek joined
librasteve I just went sudo apt-get install rakudo on my ubuntu ... it installed 22.02 with no zef ... lack of zef is a big reason why older versions are a poor option ... also there is no reasonable way that 22.02, 22.12, or 23.10 are the best choice .... what is the policy here, will these be updated anytie soon (smalles of someone doing this on a one time basis and then not maintaining / running the build chain 14:05
)
xkoncek if i understand correctly, current Rakudo does not expose any C API? i.e. there is no way to "run Raku from C code"?
similar to "lua_pcall" 14:06
librasteve xkoncek: I think you can run a callback function via FFI
xkoncek yes, i know that if possible, that's the other way around
*is
librasteve stackoverflow.com/questions/662860...rom-c-code 14:10
^^^ maybe this is helpful
xkoncek next question: is there a nice way to execute a function / C function at the end of a raku script *implicitly*? 14:11
like a shutdown hook or something
librasteve I suppose you could call the function from a LEAVE phaser in the MAIN block 14:12
and ENTER to run the set_callback stuff 14:19
[please note that the SO reply I linked has some older version of the nativecall library specifier per the note I just added] 14:20
xkoncek what are phasers? 14:22
librasteve docs.raku.org/language/phasers#LEAVE
I guess Larry Wall (the creator or raku) was a star trek fan 14:31
xkoncek i wrote some phasers at the top of a Raku script, but only the "unsuccessful" ones are executed, even when there is no other code in the script 14:33
UNDO is executed, KEEP is no
t
librasteve dev.to/lizmat/phasers-part-2-of-2-2o5e 14:42
I have just tried these example ^^ and they work fine
for 42, Nil { KEEP { say "Keeping because of $_" } UNDO { say "Undoing because of $_.raku()" } $_; # the return value of the block } 14:47
Keeping because of 42 Undoing because of Nil
^^ the default return value of a raku block is Nil ... so that's probably why you only see the UNDO 14:48
xkoncek i mean i just wrote a script like this: `UNDO say "exit";` 14:55
at the global scope
librasteve that explains it 14:58
(the top scope of a script is an implicit block)
15:34 xkoncek left
lizmat xkoncek: what's wrong with the END phaser ? 15:36
16:20 xkoncek joined 16:28 dakkar left 16:32 xkoncek1 joined 16:34 xkoncek left 16:35 xkoncek joined 16:37 xkoncek1 left 17:04 xkoncek1 joined 17:06 xkoncek left 17:11 xkoncek1 left 17:17 xkoncek joined 17:50 xkoncek left 21:12 MasterDuke joined 22:19 habere-et-disper joined
habere-et-disper Docs say `codes` is a routine... 22:24
m: say codes 3 22:25
camelia ===SORRY!=== Error while compiling <tmp>
Undeclared routine:
codes used at line 1. Did you mean 'cosec'?
23:22 habere-et-disper left 23:27 MasterDuke left