This channel is intended for people just starting with the Raku Programming Language ( Logs are available at
Set by lizmat on 8 June 2022.
02:27 teatwo left 02:28 teatwo joined 02:34 tea3po joined 02:37 teatwo left 07:30 discord-raku-bot left, discord-raku-bot joined 10:06 razetime joined
lizmat and yet another Rakudo Weekly News hits the Net: 11:07
12:15 jgaz_ left 12:17 jgaz joined 12:59 razetime left 13:00 razetime joined
knorrfg Hey, this example program raku enum AliasId <cha-prod cha-debug cha-bootl cha-prel ipg-debug ipg-release>; sub MAIN(AliasId $alias) { say $alias; } returns the usage string, when invoked with the single argument "cha-prod" I would like to automatically check that the string argument is a valid AliasId, and have it converted to that type, is that possible? 13:42
nemokosch hello, I think there are issues with loading the symbols right on time; your mileage might even vary depending on the names you pick 13:45
knorrfg ehm. Could you explain that in more detail? 13:46
nemokosch well... probably not. Sometimes it works, sometimes it doesn't.
knorrfg Ok, so in general, what can I do to make this, or something similar work reliably 13:47
nemokosch by the way, I just copied your code into a demo script and called it with cha-prod and that worked
in fact, all of this worked for me 13:48
knorrfg well. My script is a little bigger, I just extracted this. Also a module is loaded, but that shouldn't really impact things
nemokosch That might very well impact things
really, I don't know how it works and why but I have stumbled upon issues with it myself 13:49
for example, if there is a name collision with something coming from the core library (in my case that was the name Label) then it doesn't work
something that I did notice is that a module that I like to use for argument processing, Getopt::Long, fixes these issues for free 13:50 this might be your problem in some shape or form 13:51
knorrfg Ok, I'll look into it. Thanks 13:52
14:27 teatwo joined 14:30 tea3po left 14:48 teatwo left, teatwo joined 15:16 razetime left 15:17 razetime joined 16:46 razetime left 19:31 deoac left, deoac joined