🦋 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.
xinming Is there a existing script uses multi processes to manage Proc::Async? 05:46
Hmm, What I mean is, I want to script several Proc::Async, and wait for them to proceed, When one of Proc finished, I start another.
teatime doesn't sound very async :) 05:48
xinming Before I've written this kind of script once, But I had a disk failure, I lost it, So start to be clueless on how I need to sort this out again. :-(
teatime jk
xinming :-)
xinming Is there a statement where we can run the script, and break at some point, so I can test some vars? 07:25
xinming m: my @c = (0..3).map({Channel.new}); my $p = start { react whenever @c.map(*.receive) { .raku.say } }; @c[1].send("hello"); await $p; 08:25
In this example, with @c[0].send("hello"); it worked fine. 08:26
camelia (timeout)
xinming Is it possible to monitor an array of channel?
m: my @c = (0..3).map({Channel.new}); my $p = start { react { for @c { whenever .receive { .raku.say; } } }; @c[1].send("hello"); await $p; 08:27
camelia ===SORRY!=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> y; } } }; @c[1].send("hello"); await $p;⏏<EOL>
xinming m: my @c = (0..3).map({Channel.new}); my $p = start { react do { for @c { whenever $_ { .raku.say } } } }; @c[3].send("hello"); await $p; # <--- This version worked as expected, But wish something more sweet, Something like, react whenever any(@c) { ... } 08:29
camelia (timeout)"hello"
antononcube @xinming I am not sure is this going to be an useful answer — if you use Comma you can put breakpoints in your Raku programs / scripts. 12:32
gfldex m: my $var = 42; for ^10000 { repl if $_ > 1000 }; 12:41
xinming: ^^^
camelia (timeout)You may want to `zef install Readline`, `zef install Linenoise`, or `zef install Terminal::LineEditor` or use rlwrap for a line editor

Type 'exit' to leave
[0] > ===SORRY!=== Error while compiling <tmp>
Missing infix inside hyp…
12:41
xinming gfldex: Thanks. repl is what I want. 12:57
I'll search doc for what repl mean.
antononcube, will check Comma module anyway. 12:58
antononcube @xinming Comma is an Integrated Development Environment (IDE) based on IntelliJ. There is a payed version and (free) community version. There are also Comma plugins for IntelliJ. I am not sure do the community versions allow debugging. (I think that is integral part of IntelliJ, but I have not verified it…) 13:01
xinming antononcube, Ok, then I'll stick with vim. :-) 13:16
antononcube Agh — another vim-er!!! 13:17
xinming old emacs'er
antononcube Who? 🙂
I am old enough, I guess, and fan of Emacs, so I qualify, 13:18
xinming I used call myself emacs'er, I just realized I haven't use emacs for over 5+ years.
m: my $a = "world"; my @a = |<<hello $a>>; @a.raku.say; 13:23
camelia ===SORRY!=== Error while compiling <tmp>
Malformed postfix
at <tmp>:1
------> my $a = "world"; my @a = |<<hello $a>>⏏; @a.raku.say;
expecting any of:
postfix
xinming Is this a bug?
|<a b> works, But |<<a $b>> fails
antononcube Currently, I only use Emacs with/for Org-mode. I rarely use it for anything else. Org-mode, though, is a “killer feature” and integrates well with Babel. That is why “Text::CodeProcessing” can be used over Org-mode files. I.e. we can do Literate programming with Raku via Org-mode (and Babel) files. 13:27
I have been trying to figure out how to get and use ZMQ in Emacs. Using ZMQ interactive Raku with Org-mode (and Babel) we can have an Emacs “notebook solution” similar to “Jupyter::Kernel” and “RakuMode” (in Mathematica.) 13:30
* […] ”Using ZMQ to interact Raku with Org-mode …” 13:39
nemokosch the error message is horrible for sure 14:20
tells you exactly nothing, besides vaguely hinting that a syntax error happened
anyway, it seems that it parses as |<<hello (hyper operator applied to whatever hello resolves to), followed by $a>> where an operator should finish the hyper operator up 14:26
the same problem doesn't arise with |< which has no operator-like meaning
$<foo bar> bothers me more tbh 14:27
m: dd $[0, 1]; dd $<foo bar>; 14:28
Raku eval $[0, 1] (Nil, Nil)
nemokosch because it performed key lookup on the match variable $/
I for one would ban these dangling abstractions and mandate parens 14:29
it's impossible to know what the user meant so do-what-i-mean will be half of the time do-something-i-didn't-even-have-in-mind 14:30
xinming m: my @a = |<a b>; @a.raku.say; 14:48
camelia ["a", "b"]
xinming m: my @a = |<<a b>>; @a.raku.say;
camelia ===SORRY!=== Error while compiling <tmp>
Malformed postfix
at <tmp>:1
------> my @a = |<<a b>>⏏; @a.raku.say;
expecting any of:
argument list
postfix
xinming I think we have some bugs in parsers to deal with << >> 14:49
nemokosch I explained the situation, didn't I? 14:51
xinming nemokosch, You do :-) 14:55
nemokosch I wonder 15:42
can we drop the "archive" part of raku.org? 15:43
raku.org/archive
github.com/Raku/raku.org/tree/mast...ce/archive there are loads of files here but where do they even appear?
if you write the paths explicitly, you will hit some pages eventually, but much more broken links 15:44
Geth raku.org: 4d4884e120 | (Elizabeth Mattijsen)++ | 2478 files
Moved the archive to a non-accessible place
15:51
lizmat nemokosch ^^
nemokosch great, thank you, less things to (un)break 15:58
lizmat yup
git mv is your friend :-)
PolarBearXL How to get 0.37 without using EVAL?    raku -e 'say "㊲".comb(/<:N>+/).EVAL/100 ' 16:31
ugexe m: say ㊲.Int 16:35
camelia 37
ugexe m: say ㊲.Int / 100 16:36
camelia 0.37
ugexe m: say ㊲ / 100
camelia 0.37
lizmat m: say ㊲.^name 16:37
camelia Int
lizmat m: dd ㊲.Str
camelia "37"
lizmat hmmm.. wonder if we should make allomorphs of these
ugexe m: say unival("㊲") / 100 16:38
camelia 0.37
lizmat so they'd stringify back to ㊲
ugexe I dunno if making anything else allmorphs is good or not
PolarBearXL   .unival  (!)   thanks! 16:45
nemokosch I dunno if anything about allomorphs is good or not 😛 16:46
m: my Int() $not-five = <5>; say $not-five.Int === $not-five; 16:47
Raku eval False
nemokosch oh right, Int() is probably not even needed 16:48
m: my Int $not-five = <5>; say $not-five.Int === $not-five;
Raku eval False
nemokosch dang
gfldex lolibloggedalittle: gfldex.wordpress.com/2023/08/06/parenthood/ 17:15
PolarBearXL m: "③ ③ bottles" ~~ m:g/<:N>+/
camelia ( no output )
PolarBearXL m: say "③ ③ bottles" ~~ m:g/<:N>+/
camelia (「③」 「③」)
PolarBearXL m: say "33 bottles" ~~ m:g/<:N>+/ 17:16
camelia (「33」)
PolarBearXL m: say "③③ bottles" ~~ m:g/<:N>+/ 17:24
camelia (「③③」)
ugexe m: say "③" ~~ m:g/\d+/ 17:32
camelia ()
ugexe m: say ③ ~~ m:g/\d+/
camelia (「3」)
ugexe that seems kind of odd
m: say ③.Str ~~ m:g/\d+/ 17:33
camelia (「3」)
ugexe i wonder why the first and third example differ
lizmat strange indeed 17:43
nemokosch is \d for Nd? 18:19
in that case, it's another "Unicode bug" 18:20
m: '③'.uniprops.say 18:21
Raku eval (No)
nemokosch it's not Nd
gfldex m: say ‘③’.succ; 20:03
camelia
gfldex m: say ‘⓪’.succ; 20:04
camelia
gfldex m: say ‘①’.pred;
camelia Decrement out of range
in block <unit> at <tmp> line 1
gfldex Is this a Unicodebug or Rakudobug? 20:05
m: say (‘①’ .. ‘㊿’).join; 20:10
camelia ①②③④⑤⑥⑦⑧⑨⑩⑪⑫⑬⑭⑮⑯⑰⑱⑲⑳⑴⑵⑶⑷⑸⑹⑺⑻⑼⑽⑾⑿⒀⒁⒂⒃⒄⒅⒆⒇⒈⒉⒊⒋⒌⒍⒎⒏⒐⒑⒒⒓⒔⒕⒖⒗⒘⒙⒚⒛⒜⒝⒞⒟⒠⒡⒢⒣⒤⒥⒦⒧⒨⒩⒪⒫⒬⒭⒮⒯⒰⒱⒲…
gfldex :-/
nemokosch hmmm 20:25
m: ‘⓪’.Int.say
Raku eval Exit code: 1 Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏⓪' (indicated by ⏏) in block <unit> at main.raku line 1
nemokosch dammit
m: say ‘①’.Int.say;
Raku eval Exit code: 1 Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏①' (indicated by ⏏) in block <unit> at main.raku line 1
nemokosch clueless 20:26
xinming: maybe | <<Hello $asd>> would work, with the space? 21:26
lizmat m: say ‘①’.pred; # this is not a rakudo bug, but a rakudo feature 21:33
camelia Decrement out of range
in block <unit> at <tmp> line 1
lizmat gfldex: github.com/rakudo/rakudo/blob/main...1512-L1530 21:35
aka: github.com/rakudo/rakudo/blob/main...C_DEC.raku 21:36
nemokosch makeMAGIC 21:38
antononcube @Nemokosh I am making some LLM magic right now. 😎 21:49
nemokosch why don't you visit us in the Raku-study meeting? 😛 21:54
antononcube Agh... I forget about it ! When I see the announcements for it I always have the intentions to attend (or troll...) 22:02
weekly:rakuforprediction.wordpress.com/20...s-chatgpt/ 22:03
nemokosch still doesn't work via the bridge I think 22:05
antononcube Damn! (And thanks for pointing it out.) 22:06
nemokosch you can still check some weekly challenges 😂 ^^ 22:13
antononcube That is good idea, maybe. But that seems "waste of time" for me. (Since, I have a fair amount of packages to develop and document.) 22:17
I realize it is somewhat myopic point of view.
nemokosch It's okay 22:18
I think the early stages might be more interesting for you anyway
antononcube I see. 22:30