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.
00:19 Manifest0 left 03:00 Some-body_ joined 03:01 DarthGandalf left 03:04 Some-body_ is now known as DarthGandalf 04:11 MasterDuke left 07:57 dakkar joined 14:47 soverysour joined 14:48 soverysour left, soverysour joined 16:36 dakkar left
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2024/05/13/2024-...nnouncing/ 17:23
17:59 teatwo joined 18:01 teatime left, tea3po joined 18:04 teatwo left 18:12 hankache joined, teatwo joined
ay0ks Hello, I have the following slang, how can I make it define a package-level variable on usage? perl my role Debug::Grammar { rule package_declarator:sym<LOGGER> { <sym> <block> } } my role Debug::Actions { method package_declarator:sym<LOGGER>(Mu $/) { # EVAL q { # use Pretty::Debug; # our $LOGGER = Logger.new(); # } } } use Slangify Debug::Grammar, 18:15
Debug::Actions; perl LOGGER {}; # Should define $LOGGER I couldn't find any extended documentation or a tutorial covering edge cases, this is the only problem I'm facing while learning Raku.
Thanks in advance
18:16 tea3po left
Also I would be veeery grateful if anyone can recommend a book/referemce or something that really documents the language, not like the superficial think docs.raku.org is 18:18
thing* 18:19
ab5tract Think in Raku is very good 18:36
sorry, it's just Think Raku - open.umn.edu/opentextbooks/textbooks/907
but honestly docs.raku.org is a generally quite comprehensive best effort of the community 18:37
if you find something lacking, issues can be create at the github repo - github.com/Raku/doc 18:38
ay0ks I just need some documentation for this 19:09
Think Raku only has 2 occurences of the word slang
Thanks anyways
lizmat ayoks perhaps raku.land/zef:lizmat/Slangify and its reverse dependencies can serve as inspiration 19:10
ay0ks Already checked all of them, no one is doing what I want 19:13
I tried using EVAL, tried doing it with QAst but that didn't work either 19:14
lizmat do you have a description of what you want it to do ? 19:16
ay0ks Maybe codeblocks aren't showing in IRC. my role Debug::Grammar { rule package_declarator:sym<LOGGER> { <sym> <block> } } my role Debug::Actions { method package_declarator:sym<LOGGER>(Mu $/) { # Gives an error: # EVAL q { # use Pretty::Debug; # our $LOGGER = Logger.new(); # } } } use Slangify Debug::Grammar, Debug::Actions; 19:18
I'm trying to make it define a variable at package level on declaration LOGGER {};
lizmat please use some kind of pastebin for code (e.g. gist.github.com) 19:29
ab5tract you said "documents the language", not "documents Slangify" or "documents slangs" 19:30
both of those are less covered, that's true 19:31
ay0ks Slangify is just a wrapper, slangs are part of the language and should be documented, roughly docs.raku.org just says Slangs are slangs 19:32
One moment
lizmat problem is that slangs are really bleeding edge, and don't really have a stable API yet. the Slangify module is an attempt at creating a stable API 19:33
ay0ks Here: gist.github.com/ay0ks/e567e9906f7b...eecbf90fe4
gist.github.com/ay0ks/e567e9906f7b...eecbf90fe4 20:21
lizmat ayoks what's Pretty::Debug? What's Logger ?? 20:27
20:55 hankache left 21:06 soverysour left
librasteve @ay0ks - here is a very nice example of a working raku slang ... github.com/raku-community-modules/...an.rakumod ... it makes sense to me because I can see the intent in lines 138,139 ... sorry, but I cannot understand (i) what you are trying to do and (ii) how close you are to the Slangify model. if you wouldn't mind making a gist with a minimal example of the 21:16
expected inputs and outputs of your new grammar that would be very helpful
ay0ks I updated the gist gist.github.com/ay0ks/e567e9906f7b...eecbf90fe4 21:33
Also thanks for the example 21:34