🦋 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__ i look at most raku blogs and want to give like or thumbs up but stopped by various login stupidities (like having to enter a password i can’t see or captcha pictures 5mm square 01:41
well, larger but dull 01:42
hard to see anyway
xinming What is the best way to pass an customized array string to a raku script? I don't like the eval approach, But I feel it probably the only way to do so. 10:03
nemokosch What does "customized array string" mean? 10:06
antononcube @xinming For the CLI scripts of “Text::Plot” I do ad hoc parsing of the “customized arrays”. I.e. strings specifying lists of points. 10:14
xinming nemokosch, flat array can be handled with simple string split with delimiter, But multi dimentional array is hard to do in this case 11:55
antononcube thanks
nemokosch yeah well, you could parse it recursively 12:54
depends on how formal your input is
if it has some simple formalism, then maybe it's still better to parse it than to EVAL it; if it really is some arbitrary Raku content then obviously you can't beat EVAL 12:55
antononcube @xinming I thinking this might be a good use case for "Text::SubParsers" -- I face similar problems when dealing LLM outputs. (I strategically do what @nemokosch outlined above.) 13:19
librasteve I would like to get my blog added to planet.raku.org ... seems that Roman Baumer is listed as the contact. Does he ever stop by here? By what name? 14:11
lizmat librasteve what's the RSS feed URL ?
librasteve planet.raku.org/atom.xml 14:12
lizmat no, I mean of your blog :-) 14:13
librasteve rakujourney.wordpress.com
lol
lizmat gimme a o 14:14
mo
ok, updated... should be live in an hour or so 14:22
nemokosch pretty sure Roman Baumer stopped being the contact but who is it then 14:31
lizmat I put myself in for now 14:32
gfldex :q1 14:59
lizmat librasteve you're in! 15:30
xinming nemokosch, I know we can have EVAl, But that's the last option to choose. 16:12
antononcube, thanks.
nemokosch not sure why you said that though 16:13
xinming nemokosch, EVAL can run all things in the script.
nemokosch I know but why are you saying this? Why is this your takeaway? 16:14
xinming the script will probably run with another user. 16:15
nemokosch okay, I guess I'll never know why you said this 😄 16:27
antononcube @lizmat Please include rakuforprediction.wordpress.com !!! 🙂 16:28
lizmat antononcube will do 16:29
Geth planet.raku.org: 2ac1bacf72 | (Elizabeth Mattijsen)++ | perlanetrc
Add Anton Antonov
16:30
lizmat should be live in about an houre
*hour
antononcube @lizmat Thanks! 16:33
nemokosch say Foo explodes at compile time but say Foo::Bar only explodes at runtime 16:45
these are such demotivating nonsensical things
even say Foo::{'Bar'} or say Foo::<Bar> will blow up at compile time 16:46
but the one that looks the least like an operation, makes it to runtime
Geth planet.raku.org: dc4a563cea | (Elizabeth Mattijsen)++ | perlanetrc
Arhg, messed up Anton Antonov's feed URL
17:22
lizmat antononcube sorry, will take another hour :-(
rf What library is recommended for SHA1? 19:12
ugexe m: sub sha1($str) { (CompUnit::Repository::Distribution but role :: { method Str { $str } }).id }; say sha1("abc") 19:17
camelia A9993E364706816ABA3E25717850C26C9CD0D89D
ugexe just use nqp::sha1 by abusing other actual public apis!
xinming Is there a ubuntu repo for newest rakudo compiler? 19:18
I'm using gentoo, so I compile each time with new release, But another machine I manage which is ubuntu. 19:19
rf ugexe nice!
xinming So, looking for a lazyman's way
rf Rakubrew
xinming the built-in raku is 2019.12
rf Is your best friend
xinming Thanks, will check that, I never know that 19:20
rf ugexe do you know how that performs vs something like Digest::SHA1 native or Digest? 19:21
I've seen that NQP is unearthly fast sometimes 19:22
ugexe i was only joking
rf Lol. I know just pondering 19:23
ugexe nqp::sha1 is probably fairly optimized
rf I'm adding web-sockets to Humming-Bird and you have to do a dance of SHA1 -> Base64 + Magic string to enable comms, that's why this came up 19:24
librasteve brilliant - thanks! 20:07
++ 20:09
El_Che xinming: github.com/nxadm/rakudo-pkg 21:19
lizmat for all the vim users: groups.google.com/g/vim_announce/c/tWahca9zkt4 21:25
japhb I'm blanking -- is there syntactic relief for passing on an optional named argument *only if it was defined*? In other words, something to clean up the inner call of `method a(:$optional = True) { dd $optional }; method b(:$some, :$optional, :$args) { self.a(|(:$optional if $optional.defined)) }` 21:29
lizmat :optional($_) with $optional 21:31
?
japhb Hmmm 21:32
Will that avoid having to wrap in |() as well?
lizmat no, don't think so 21:33
japhb Gah, that's annoying.
(Although thanks for the idea, lizmat++)
I guess I'm wanting something like a `:?$optional` syntax 21:34
lizmat the other idea, if there are multiple cases like this, is to set up a hash, and than flatten the hash into the arguments
japhb lizmat: Yeah, I do that in a couple places. It doesn't end up being hugely shorter, but sometimes it's at least a bit more clear