[00:23] *** rmv left
[01:55] *** hulk joined
[01:55] *** kylese left
[02:10] *** Sgeo_ left
[02:11] *** Sgeo joined
[02:15] *** hulk left
[02:15] *** kylese joined
[02:37] <disbot4> <simon_sibl> I am getting crazy xD is that expected that when I assign to a @variable using a ternary !! ?? the hash I create get flattened ?

[02:38] <disbot4> <simon_sibl> @!files = %info<files>:exists ?? %info<files>.map: {%(:path(.<path>.join('/')), :length(.<length>))} !! [%( :path($!name), :length(%info<length>) )];

[02:39] <disbot4> <simon_sibl> even when using [%()] it somehow flattens it and then I get error when I wanna do @!files>>.<length>.sum

[02:44] <Voldenet> hm, but it does work

[02:45] <Voldenet> m: my %info = files => [{ path => ["foo","file1.txt"], length => 123 }, { path => ["dir","sub","file2.txt"], length => 456 }]; my $name = "default.txt"; my @files = %info<files>:exists ?? %info<files>.map: {%(:path(.<path>.join("/")), :length(.<length>))} !! [%(:path($name), :length(%info<length>) )]; say @files>>.<length>.sum; say @files.raku

[02:45] <camelia> rakudo-moar 20c3028c4: OUTPUT: «579␤[{:length(123), :path("foo/file1.txt")}, {:length(456), :path("dir/sub/file2.txt")}]␤»

[02:55] <disbot4> <simon_sibl> hmmm how come

[02:55] <disbot4> <simon_sibl> in my code when I do @files>>.<length> it gives me (Nil, 661651456) wihch then error, and it gives Nil because it flattens the map, so :path of course isnt a number

[02:57] *** Sgeo left
[02:57] <disbot4> <simon_sibl> https://glot.io/snippets/hjtmuwf01c

[02:58] <disbot4> <simon_sibl> I really dont know whats going on xD

[03:01] <disbot4> <simon_sibl> Oh wait your example yes, it works for me with multiple files But when there is only one so not the <files> then it doesn’t work

[03:04] *** Sgeo joined
[03:08] *** Sgeo left
[03:09] *** Sgeo joined
[03:09] <disbot4> <simon_sibl> is it a bug or I am doing something stupid

[03:16] *** Sgeo_ joined
[03:18] *** Sgeo left
[03:25] *** Sgeo_ left
[03:25] *** Sgeo joined
[03:44] *** Sgeo left
[03:45] *** Sgeo joined
[03:46] <wayland76> simon_sibl: More context would help.  Note that in Voldenet's case, he gave some sample data, and code that actually runs.  Yours likely wouldn't run because it's inside a submethod that never gets called.  Are

[03:47] <wayland76> you able to give us something more focussed?  

[03:47] <disbot4> <simon_sibl> let me try to give some data for the test

[03:50] <disbot4> <simon_sibl> https://glot.io/snippets/hjtoavcwfl

[03:50] <disbot4> <simon_sibl> here can see the issue with the data

[03:51] *** cm left
[03:58] *** cm joined
[04:02] <wayland76> simon_sibl: I have a solution for you

[04:03] <disbot4> <simon_sibl> amazing, did I do something wrong or its expected behavior ?

[04:03] <wayland76> Just after the parenthesis closing the has (and just inside the `]` ) add a comma.  

[04:05] <disbot4> <simon_sibl> omg indeed

[04:05] <disbot4> <simon_sibl> but why xD why does it require a comma ?

[04:05] <disbot4> <simon_sibl> thank you !!

[04:05] <wayland76> I think it's something to do with https://docs.raku.org/language/list#Flattening_%22context%22 .  

[04:07] *** Sgeo left
[04:08] *** Sgeo joined
[04:08] <wayland76> Maybe not -- I'm still looking.  

[04:10] <wayland76> My mistake -- I was inspired by the part of https://docs.raku.org/language/list -- the first code block.  

[04:10] <wayland76> Maybe someone who knows more will chime in.  

[04:42] *** Sgeo left
[04:43] *** Sgeo joined
[04:50] *** Sgeo left
[04:52] *** Sgeo joined
[04:54] *** rmv joined
[04:58] *** rmv left
[05:06] *** Sgeo left
[05:07] *** Sgeo joined
[05:33] *** vasko4535586 left
[05:39] *** vasko4535586 joined
[06:18] *** Sgeo left
[06:19] *** Sgeo joined
[06:30] *** Sgeo left
[06:30] *** Sgeo joined
[06:34] *** Sgeo left
[06:47] <disbot4> <simon_sibl> if in a whenever block I put a await Promise.in(5), during those 5 seconds will other whenever block be ran or it will just block everything for 5 seconds ? since I read that only 1 whenever block can run at a time

[06:48] <lizmat> it will block

[06:48] <disbot4> <simon_sibl> hmmmm

[06:48] <disbot4> <simon_sibl> not sure whats the right/easy way to have a whenever Supply.Interval but with a dynamic interval..

[06:48] <disbot4> <simon_sibl> (the interval is a variable that changes over time basically)

[06:51] <lizmat> my $time = 1; my $interval = Promise.in($time); react { whenever $interval { $interval = Promise.in($time * 2 } } }

[06:51] <lizmat> off the top of my head

[06:52] <lizmat> $time *= 2

[06:54] <disbot4> <simon_sibl> wait to be very sure, is there a reasy to do $time*2 ?

[06:54] <disbot4> <simon_sibl> why cannot reuse $time ?

[06:54] <lizmat> sure, I just used *= 2 because you wanted it to be variable

[06:54] <disbot4> <simon_sibl> ah okok, all good then xD thanks !!

[06:55] <lizmat> and doubling timeout is a common idiom

[06:56] <disbot4> <simon_sibl> but I am still a bit confused, if I do whenever Supply.interval($var) it wont work, but if I give whenever $interval it works ? why in the first case it doesnt eval again the whenever but in the second case it does ?

[06:59] <lizmat> if I remember react / whenever internals correctly, it is just syntactic sugar for setting up a call to an internal WHENEVER subroutine that takes code blocks (the whenever blocks)

[07:02] <lizmat> hmmm...  sorry, I got up at 5am to open all windows to cool everything a bit down, as it's going to be at least 38 degrees here today

[07:02] <disbot4> <simon_sibl> I believe my brain is too tired to understand this statement now xD

[07:03] *** abraxxa joined
[07:03] <disbot4> <simon_sibl> ouch good luck ! enjoying the AC at the office now

[07:03] <lizmat> I'm probably to sleepy now to be coherent...

[07:03] <lizmat> *too

[07:03] <disbot4> <simon_sibl> helped me a lot already ! I can get the peers from the tracker and respect the timeout xD

[07:06] <wayland76> lizmat: Good idea (with the windows, though we usually do it the night before).  As an Australian my advice is also: a) shut all blinds on the sunny sides, and b) a damp washcloth on the forehead (or neck, or back) and a fan blowing on the washcloth can go a long way.  HTH, 

[07:07] <lizmat> thanks... we have blinds, and almost all have gone down by now  :-)

[07:09] <lizmat> 32.1 at 9am

[07:20] *** rmv joined
[07:20] *** rmv left
[07:20] *** rmv joined
[07:25] *** rmv left
[08:25] <disbot4> <librasteve> crag "32.1ºC in 'ºF'" #89.78°F

[08:33] <apogee_ntv> AC is cranked all the way down. Heat is dispersing.

[08:33] <apogee_ntv> Power bill will not be pleasant.

[08:37] <disbot4> <librasteve> its 27ºC now in SE England heading to 32ºC max - and humidity is 67% (down from 85% and 36ºC on Weds) ... imo humidity is the killer ... saving £££ on holidays in Spain

[08:38] <apogee_ntv> 26 here heading to 33 (Midlands)

[08:38] <apogee_ntv> I live on a narrowboat so humidity is definitely the killer

[08:38] <disbot4> <librasteve> on t'cut

[08:39] <apogee_ntv> Parked in a Marina for the heat wave just to run the air con

[08:39] <apogee_ntv> But yes usually :D

[08:40] <apogee_ntv> Been topping up like £12 a day in electric...

[08:41] <apogee_ntv> I am used to a lifestyle where everything runs on my solar array lol, usually only do marina in winter to avoid getting frozen in place in the middle of nowhere

[08:42] <apogee_ntv> And because solar in winter in the UK gives you basically nothing

[08:51] <apogee_ntv> Weeks like this I miss winter :D

[08:52] <disbot4> <librasteve> it'll be back when the gulf stream shuts down

[09:16] <librasteve_> on the racket vs raku discussion, I am still a bit vague about the differences / similarities, so I thought I would try making the invoice DSL example https://play.slangify.org/266cc36037e8c54f32ebf8da93ba298843ab786f  in Racket

[09:16] <librasteve_> https://www.irccloud.com/pastebin/IY0Z8pcR

[09:18] <librasteve_> did the same in Rhombus also

[09:18] <librasteve_> https://www.irccloud.com/pastebin/QmJXAyuB

[09:36] <librasteve_> even the Rhombus one looks too lispy ((()))) for my taste ;-)

[09:38] <librasteve_> it seems that Racket / Rhombus is a bit more structured than Raku when it comes to “I want to make a `#lang invoice_dsl` module (see https://chatgpt.com/s/t_6a3e476211488191be43ff06c3dc30d0 - warning LLM!!) … I sense a new post coming “how to package your Raku slang as a standalone compiler”

[09:41] <librasteve_> wayland: I am curious about your point that Raku slangs cannot reuse syntax from the main Raku Grammar … now that the RakuAST project has recast the rakudo front end as a Raku Grammar, my expectation is that you could fairly easily inherit chunks from that in your own custom Grammar?

[09:44] <patrickb> librasteve_: Just so you are aware: The legacy compiler is also a raku grammar (i.e. written in raku using grammars).

[09:47] <disbot4> <librasteve> interesting - can you do something like this then:-

[09:47] <disbot4> <librasteve>  grammar Base {     token TOP  { <word>+    }     token word { <[a..z]>+  } } grammar Extended is Base {     token word { <[a..z]>+ | <[0..9]>+ } } 

[09:49] <disbot4> <librasteve> does Rainbow also have a Raku Grammar? is there an optimum way to actually use the Grammar such as use Base; in my example?

[10:11] <patrickb> I know near to nothing about grammar extensibility and would delegate that question to someone else.

[10:11] <timo> i'm also surprised why you said specifically the fact that slangs are roles means you can't reuse code from the existing grammar

[10:11] <patrickb> Rainbow is also written using a ralu grammar.

[10:12] <timo> if you just pretend a grammar is just a class and a regex/rule/token is just a method, you'll be very close to how it works and what you can do with it

[10:32] <wayland76> librasteve_: That's what I was hoping too, but when I tried to use <signature> in my grammar, it complained that it couldn't find it.  I think it's because, if it was a grammar that inherited, it would inherit <signature>,and everything would work, but because it's the grammar equivalent of a role that then gets mixed into the live grammar, it can't reference the rules in the live grammar.  

[10:32] <wayland76> That was my experience, but I've been a pretty early adopter, so someone may've adjusted that.  

[10:37] <timo> when you put a slang in, i'm pretty sure it mixes in your role to the language at-the-time. if you can reproduce that issue still, that's either a bug or something wrong in the rest of your code

[10:45] <wayland76> timo: The first part of your statement is correct, but the problem is that it fails to parse it with references to <signature> before it even gets to that point.  

[10:46] <timo> interesting. early at compile time of the module you declared your slang role in?

[10:46] <timo> m: role blergh { regex a { <signature> } }

[10:46] <camelia> rakudo-moar 20c3028c4: ( no output )

[10:47] <wayland76> timo: See the example at https://docs.raku.org/language/slangs#A_Slang_Example

[10:50] <timo> right, I expected you'd be using Slangify

[10:54] <wayland76> timo: Yes, that's correct.  But I've had a bit of a look, and that may've been corrected.  

[10:54] <wayland76> Which would be nice :) .  

[10:54] <timo> cool, maybe you posted the error in here and someone figured it out and committed a fix?

[10:55] <wayland76> Might just've been the price of being too early an adopter :) 

[10:55] <wayland76> Yeah, could be.  

[11:04] <disbot4> <librasteve> aha - that example is just the missing piece I was looking for - I had missed the point that Slangify can override internal tokens (need to sharpen up my Slangify skills)

[11:08] <wayland76> librasteve_: I wrote that Slangs page because it was the piece I was missing :) .  But the code is lizmat's.  

[11:18] *** rmv joined
[11:23] *** rmv left
[12:38] *** donaldh left
[12:40] *** donaldh joined
[13:20] *** rmv joined
[13:22] *** donaldh left
[13:23] *** abraxxa left
[13:25] *** rmv left
[13:41] <[Coke]> (5am) we got up at 5am here to turn the AC on because it was already miserable :)

[14:07] *** hurufu joined
[14:54] *** Sgeo joined
[15:02] <timo> today it was already getting too hot to keep the windows open before 9am; 29 degC

[15:12] *** Sgeo left
[15:14] *** Sgeo joined
[15:31] *** donaldh joined
[15:35] *** Sgeo left
[15:36] *** Sgeo joined
[15:42] *** wayland joined
[15:42] *** wayland76 left
[15:46] *** human-blip left
[15:46] *** Aedil left
[15:48] *** human-blip joined
[16:00] *** Sgeo left
[16:01] *** Sgeo joined
[16:12] *** Aedil joined
[16:14] *** Sgeo left
[16:17] *** Sgeo joined
[16:18] <Voldenet> I've looked at the example I've posted earlier again and indeed, the second branch is wrong because it converts hash into list of pairs – [] is not even necessary

[16:18] <Voldenet> m: my %info = length => 42; my $name = "default.txt"; my @files = %info<files>:exists ?? %info<files>.map: {%(:path(.<path>.join("/")), :length(.<length>))} !! [%(:path($name), :length(%info<length>) )]; say @files>>.<length>.sum; say @files.raku # broken

[16:18] <camelia> rakudo-moar 20c3028c4: OUTPUT: «Use of Nil in numeric context␤42␤[:path("default.txt"), :length(42)]␤  in block <unit> at <tmp> line 1␤»

[16:18] <Voldenet> m: my %info = length => 42; my $name = "default.txt"; my @files = %info<files>:exists ?? %info<files>.map: {%(:path(.<path>.join("/")), :length(.<length>))} !! {:path($name), :length(%info<length>)},; say @files>>.<length>.sum; say @files.raku # note the , after {}

[16:18] <camelia> rakudo-moar 20c3028c4: OUTPUT: «42␤[{:length(42), :path("default.txt")},]␤»

[16:19] *** Sgeo left
[16:21] *** Sgeo joined
[16:25] *** Sgeo left
[16:25] *** Sgeo joined
[16:35] *** Sgeo left
[16:38] *** Sgeo joined
[16:47] *** Sgeo left
[16:48] <disbot4> <simon_sibl> finally its usable: https://github.com/4zv4l/rbt

[16:48] <disbot4> <simon_sibl> although very barebone

[16:48] <disbot4> <simon_sibl> much cleaner than the one I made in Golang few months ago

[16:50] <disbot4> <simon_sibl> at least it allows me to download debian netinstall xD

[16:52] *** Sgeo joined
[17:05] <disbot4> <librasteve> @simon_sibl ++

[17:06] <disbot4> <simon_sibl> It’s probably just me not getting the doc right, but not being able to see exception from start {} blocks made it quite hard to find why the peers got disconnected all the time xD

[17:07] <disbot4> <simon_sibl> (For the Peers.work method)

[17:08] <timo> if you don't `await` the promise from a `start { ... }`, you're not going to get the exception, yeah

[17:10] <timo> you should almost always be awaiting your promises or otherwise reacting to their statuses

[17:26] <disbot4> <simon_sibl> I didn’t think of adding a whenever in the loop on which I start the peer workers, something I could try

[17:26] <disbot4> <simon_sibl> In*

[17:31] *** Sgeo left
[17:31] *** Sgeo joined
[17:32] <Voldenet> wow, impressive

[17:32] *** hurufu left
[17:36] <timo> ah you're in a supply or react block. yes, then "whenever" is probably the better choice

[17:41] *** guifa_ joined
[17:43] <Voldenet> actually Downloader already uses .then on .work

[17:43] <Voldenet> so it contains the cause

[17:45] <Voldenet> but the whole contraption of `supply { whenever { promise().then(…) }}` may make it quite hard to understand

[17:51] <Voldenet> also, having `start { }` inside whatever seems to be single-threaded code is such a waste

[17:52] *** Sgeo left
[17:54] *** Sgeo joined
[17:55] <guifa_> so ended up shifting focus for a talk @ TPRC.  Instead of multicast (since I didn't have time to fully finish getting that implemented), going to talk about my new URI module

[18:04] <Voldenet> m: class Peer { has $.me; method !p(*@_) { say ($.me, |@_) }; method work { supply { whenever Promise.in(.2) { self!p: "c"; whenever Promise.in(.1 * $.me) { self!p: "download" }; whenever Promise.in(.4 * $.me) { self!p: "end"; done; } } } } }; react whenever (1..5) { whenever Peer.new(:me($_)).work { } }

[18:04] <camelia> rakudo-moar 20c3028c4: OUTPUT: «(2 c)␤(3 c)␤(1 c)␤(4 c)␤(5 c)␤(1 download)␤(2 download)␤(3 download)␤(4 download)␤(1 end)␤(5 download)␤(2 end)␤(3 end)␤(4 end)␤(5 end)␤»

[18:09] *** El_Che left
[18:18] <guifa_> although I'm slightly annoyed that there's another module called `URI` lol

[18:19] *** Sgeo_ joined
[18:20] *** Sgeo left
[18:22] *** librasteve_ left
[18:24] <[Coke]> theoretically that doesn't matter.

[18:37] <guifa_> theoretically

[18:38] <guifa_> both the URI and URL modules work fine, but they're either don't implement all the standard strictly or implement far more than the standard.  I'm aiming for an extensible strictly compliant module

[18:39] <guifa_> FWIW: Ruth just announced TPRF currently has funds available for Raku community grants

[18:42] <Voldenet> oh and continuing the above, to handle the errors in `work` QUIT can be used in the right place

[18:42] <Voldenet> m: class Peer { has $.me; method !p(*@_) { say ($.me, |@_) }; method work { supply { whenever Promise.in(.2) { self!p: "c"; whenever Promise.in(.1 * $.me) { self!p: "download"; die "three" if $.me == 3 }; whenever Promise.in(.4 * $.me) { self!p: "end"; done; } } } } }; react whenever (1..5) { whenever Peer.new(:me($_)).work { } } # fails

[18:42] <camelia> rakudo-moar 20c3028c4: OUTPUT: «(1 c)␤A react block:␤  in block <unit> at <tmp> line 1␤␤Died because of the exception:␤    three␤      in block  at <tmp> line 1␤␤(3 c)␤(4 c)␤(2 c)␤(5 c)␤(1 download)␤(2 download)␤(3 download)␤»

[18:44] <Voldenet> erm

[18:44] <Voldenet> ah, right, it works right but stderr is misplaced ;p

[18:45] <timo> yeah, camelia tends to mix stdout and stderr together

[18:46] <Voldenet> m: class Peer { has $.me; method !p(*@_) { say ($.me, |@_) }; method work { supply { whenever Promise.in(.2) { self!p: "c"; whenever Promise.in(.1 * $.me) { self!p: "download"; die "three" if $.me == 3 }; whenever Promise.in(.4 * $.me) { self!p: "end"; done; } } } } }; react whenever (1..5) -> $me { whenever Peer.new(:$me).work { QUIT { default { say "peer $me failed ", $_ } } } } # nesting supplies

[18:46] <camelia> rakudo-moar 20c3028c4: OUTPUT: «(1 c)␤(2 c)␤(3 c)␤(4 c)␤(5 c)␤(1 download)␤(2 download)␤(3 download)␤peer 3 failed three␤  in block  at <tmp> line 1␤␤(1 end)␤(4 download)␤(5 download)␤(2 end)␤(4 end)␤(5 end)␤»

[18:46] <Voldenet> one peer dies, but other peers are alive

[18:46] <Voldenet> and the whole supply lives until any peer is up

[18:47] <Voldenet> the whole react, even

[18:53] <Voldenet> I'm not sure if info about QUIT in docs is sufficient, it's very terse

[18:53] *** disbot4 left
[18:54] *** disbot1 joined
[18:55] <Voldenet> but it's crucial to use when writing loops with sub-loops

[18:58] *** guifa_ left
[19:10] *** Guest98 joined
[19:11] <Guest98> Hello, I am a long time lurker and has been a while I don’t check raku

[19:11] <Guest98> I wonder how much it improved, did the rakuast landed?

[19:13] <Guest98> I wonder if anyone knows what happened to a lad called Zoffix Znet? I cannot find any updated info on the net

[19:14] <Guest98> does anyone also remember him?

[19:16] <Guest98> did he switch to python like everyone else?

[19:16] <timo> last I heard he was just doing stuff other than raku, but that was already a while ago. I do remember, and miss him

[19:21] *** Guest98 left
[19:23] <timo> but yes, RakuAST has mostly landed. the team's been busy ironing out bugs that show up when running the ecosystem modules' tests with a rakudo that's compiled itself with rakuast and then also the module and tests with rakuast

[20:12] <patrickb> I'd like to build a CLI where I have a fixed set of options first, then a positional followed by arbitrary further args. (debugger args: e.g. "--suspend script.raku some args for that --script")

[20:12] <patrickb> There is little chance to do this with MAIN, right?

[20:13] <patrickb> Will Get opt::Long help?

[20:21] <patrickb> It seems getopt::long will not help. Possibly ARGS-TO-CAPTURE can do the trick...

[20:22] *** guifa_ joined
[20:22] <guifa_> Zoffix does pop around once in a blue moon, I think he submitted a PR a few months ago iirc

[20:30] <timo> i think there's an option you can set for the MAIN feature

[20:30] <timo> hm, actually, maybe not

[20:31] <timo> you want something like "--", right?

[20:34] <patrickb> Yeah. The tricky bit is to make the first positional be a separator. Known associatives ("--bla") before, anything after.

[20:34] <patrickb> Args-to-capture might really do the trick.

[20:46] *** guifa_ left
[20:51] <lizmat> note that you can pre-process @*ARGS in any way, shape or form you want  :-)

[20:52] <lizmat> m: @*ARGS = "foo"; sub MAIN($a) { dd $a }

[20:52] <camelia> rakudo-moar 20c3028c4: OUTPUT: «"foo"␤»

[21:18] *** MasterDuke joined
[21:21] *** guifa_ joined
[22:08] *** MasterDuke left
[22:14] *** guifa_ left
[22:48] *** guifa_ joined
[22:52] *** guifa_ left
