[00:34] *** Guest4 joined
[00:47] <Guest4> The documentation for 'reduce' seems to imply it will simply return the sole item of a list when given a list of length 1, but I always seem to get a "too few positionals passed" error when I try. It seems to work with some built-ins, like &infix:<+>, but not with anything else I try. Is the documentation wrong?

[01:24] <[Coke]> can you give an example that fails?

[01:24] <[Coke]> m: say reduce &infix:<->, (1,);

[01:24] <camelia> rakudo-moar f25d6a249: OUTPUT: «1␤»

[01:25] <[Coke]> if your sub only takes 2 args, it can't take just 1, so this will fail:

[01:25] <[Coke]> m: sub j($a, $b) { $a * $b }; say reduce &j, (1,);

[01:25] <camelia> rakudo-moar f25d6a249: OUTPUT: «Too few positionals passed; expected 2 arguments but got 1␤  in sub j at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»

[01:26] <[Coke]> m: sub j($a, $b=1) { $a * $b }; say reduce &j, (1,);

[01:26] <camelia> rakudo-moar f25d6a249: OUTPUT: «1␤»

[01:26] <[Coke]> but since the second arg has a default there, that will work.

[01:26] <[Coke]> Guest4: hope that helps.

[01:31] <Guest4> Perhaps I am reading too much into the documentation. I was hoping I could avoid a bunch of length checks in my code and reduce would do it for me.

[01:32] <[Coke]> are you trying to reduce with a builtin or your own 2-arg sub?

[01:34] <Guest4> My own. Not dissimilar to your second example.

[01:35] <[Coke]> ok. the core ones do this not by having a single sub doing 1 and 2 arg versions, but with a multi sub.

[01:36] <[Coke]> e.g. there is a multi sub infix:<+>($x) { $x.Numeric }

[01:36] <[Coke]> That's probably the easiest way to do it. Can you point me at the doc URL you were reading? I can add a note to that effect.

[01:37] <Guest4> https://docs.raku.org/routine/reduce

[01:45] <Guest4> It never occurred to me to try a mutli sub. Thanks for the help.

[01:49] <[Coke]> I think the text there is incorrect, actually, it says:

[01:49] <[Coke]> If list contains just a single element, the operator is applied to that single element if possible; if not, it returns the element itself.

[01:50] <[Coke]> I'll rework that sentence to mention the multi (and double check the reduce implemenation that this isn't an error)

[01:51] <[Coke]> Guest4: https://github.com/Raku/doc/issues/4816

[02:01] *** hulk joined
[02:02] *** kylese left
[02:15] *** hulk left
[02:15] *** kylese joined
[02:28] *** guifa_ left
[02:29] *** guifa joined
[02:33] *** rmv left
[02:51] *** Guest4 left
[03:03] *** leppard left
[03:46] *** rmv joined
[03:51] *** rmv left
[04:39] *** hurufu joined
[06:19] *** vrurg joined
[06:22] *** vrurg_ left
[06:33] *** rmv joined
[06:38] *** rmv left
[07:32] *** guifa left
[07:32] *** guifa_ joined
[07:39] *** leppard joined
[08:34] *** tonyo left
[08:35] *** rmv joined
[08:36] *** tonyo joined
[08:39] *** rmv left
[08:49] *** tonyo left
[08:53] *** tonyo joined
[09:01] *** tonyo left
[09:03] *** tonyo joined
[09:16] *** tonyo left
[09:28] *** tonyo joined
[09:33] *** tonyo left
[09:34] *** tonyo joined
[09:46] <Voldenet> I say docs about sleep and one thing is peculiar to me - there exists Duration (that sleep accepts) but Duration can't be initialized with minutes, hours etc.

[09:51] *** tonyo left
[09:51] <Voldenet> it can be done easily so maybe it could be accepted form of .new

[09:52] <Voldenet> m: sub duration { my $n = DateTime.new(0); $n.later(|%_) - $n.$_ }; say duration(:2days); say duration :3hours;

[09:52] <camelia> rakudo-moar f25d6a249: OUTPUT: «172800␤10800␤»

[09:57] *** tonyo joined
[09:59] <lizmat> interesting idea

[10:00] <lizmat> I guess it makes sense up to :weeks

[10:04] *** oodani left
[10:05] <Voldenet> Duration having units overall makes sense, just maybe not when combined with sleep

[10:05] *** oodani joined
[10:06] <lizmat> m: sleep Duration.new(1); say now - INIT now

[10:06] <camelia> rakudo-moar f25d6a249: OUTPUT: «1.001584075␤»

[10:06] <lizmat> think it works fine?

[10:07] <Voldenet> yeah, sleep accepts the duration

[10:08] <Voldenet> duration gets converted into numeric probably

[10:10] <Voldenet> either way, C# has similar class (it uses ticks internally) and it accepts `(d?, h,m,s)` as .new (and has ToString for that): https://github.com/microsoft/referencesource/blob/main/mscorlib/system/timespan.cs

[10:10] <lizmat> actually, Duration nowadays store nanoseconds

[10:10] <lizmat> *stores

[10:14] *** tonyo left
[10:16] <Voldenet> tick in TimeSpan context is 100ns I think, so storing ns is more precise

[10:16] <Voldenet> + can use nanosleep directly

[10:22] *** tonyo joined
[10:23] *** rmv joined
[10:24] *** rmv left
[10:24] *** rmv joined
[10:25] <rmv> Hi everyone, trying to upload my first zef package. Is the server down? fez upload failing with a bunch of timeouts...

[10:27] *** tonyo left
[10:29] <lizmat> confirmed   :-(

[10:29] <lizmat> .tell tonyo looks like fez is having issues

[10:29] <tellable6> lizmat, I'll pass your message to tonyo

[10:30] <lizmat> rmv: only thing I can say is: please try again later 

[10:30] <lizmat> and thank you for creating your first zef package!  :-)

[10:30] <rmv> no worries, I'll try later! thanks

[10:33] <Voldenet> m: use MONKEY-TYPING; augment class Duration { multi method new { my $n = DateTime.new(0); $n.later(|%_) - $n.$_ }; method X { self.polymod(60,60,24).&{my@p=$_; (@p.first(*!=0,:end,:k) // 0…0).map({ @p[$_].fmt("%02d")}).join(":") } } }; for (:2days, :3hours, :4minutes, :5seconds, 6) { Duration.new(|$_).X.say }

[10:33] <camelia> rakudo-moar f25d6a249: OUTPUT: «02:00:00:00␤03:00:00␤04:00␤05␤06␤»

[10:33] <Voldenet> something like that is what I'd have in mind for additional .new and .Str, but if anyone is using Str then obviously it might stop working

[10:35] *** tonyo joined
[10:40] *** tonyo left
[10:44] *** belluzj joined
[10:46] *** tonyo joined
[10:47] *** belluzj left
[11:10] *** Sgeo left
[11:13] *** tonyo left
[11:16] *** tonyo joined
[11:19] <lizmat> Voldenet: the logic in DateTime.later should probably be abstracted into Internals and then used for Duration as well

[11:22] <lizmat> or make Duration.new canonical and use that in DateTime.later

[11:30] *** tonyo left
[11:35] *** tonyo joined
[11:42] *** tonyo left
[11:50] *** tonyo joined
[12:15] *** tonyo left
[12:19] *** tonyo joined
[12:23] *** tonyo left
[12:33] *** tonyo joined
[12:38] *** tonyo left
[12:48] *** tonyo joined
[12:53] *** tonyo left
[12:56] *** tonyo joined
[13:08] <Voldenet> I'm actually not sure, .later uses DateTime.move-by-unit or Date.move-by-unit which actually do operations on the storage

[13:08] *** tonyo left
[13:09] <Voldenet> but in Duration case constants would be used to add to some base number

[13:09] <Voldenet> so Duration could implement it in more trivial way

[13:19] *** tonyo joined
[13:25] *** tonyo left
[13:29] *** tonyo joined
[13:34] *** tonyo left
[13:41] *** tonyo joined
[13:51] *** tonyo left
[14:00] *** tonyo joined
[14:05] *** tonyo left
[14:08] *** Pixi` joined
[14:08] *** rnddim joined
[14:09] *** Pixi left
[14:09] *** ShimmerFairy left
[14:33] *** tonyo joined
[14:44] *** tonyo left
[14:54] *** tonyo joined
[14:56] *** rmv left
[14:56] *** rmv joined
[15:08] *** tonyo left
[15:14] *** tonyo joined
[15:20] *** tonyo left
[15:25] *** tonyo joined
[15:31] *** tonyo left
[15:33] *** tonyo joined
[15:38] *** tonyo left
[15:47] *** tonyo joined
[15:59] *** tonyo left
[16:00] *** tonyo joined
[16:09] *** tonyo left
[16:17] *** tonyo joined
[16:25] *** tonyo left
[16:27] *** tonyo joined
[16:37] *** tonyo left
[16:47] *** tonyo joined
[16:55] *** rmv left
[16:55] *** rmv joined
[16:56] *** rmv left
[16:57] *** rmv joined
[17:05] *** tonyo left
[17:17] *** guifa_ left
[17:17] *** guifa joined
[17:19] *** tonyo joined
[17:24] *** camelia left
[17:24] *** nine_ left
[17:26] *** tonyo left
[17:26] *** camelia joined
[17:29] *** nine joined
[17:29] *** tonyo joined
[17:43] *** tonyo left
[17:46] *** tonyo joined
[17:51] *** tonyo left
[17:56] <apogee_ntv> Is fez working for everyone else? I'm just getting a hang when trying to run it with no output

[17:56] <apogee_ntv> to upload or login

[18:02] <rmv> apogee_ntv: Had the same problem earlier. Seems to be down.

[18:03] <apogee_ntv> F

[18:04] <apogee_ntv> Who do we ping to fix it? :D

[18:07] *** tonyo joined
[18:10] <rmv> lizmat pinged tonyo (https://irclogs.raku.org/raku/2026-06-20.html#10:29)

[18:11] *** tonyo left
[18:13] *** tonyo joined
[18:24] *** tonyo left
[18:27] *** rmv left
[18:30] *** tonyo joined
[18:39] *** rmv joined
[18:43] *** rmv left
[18:47] *** tonyo left
[18:55] *** tonyo joined
[18:56] *** rnddim is now known as ShimmerFairy

[18:59] *** tonyo left
[19:03] *** Sgeo joined
[19:07] *** rmv joined
[19:24] *** tonyo joined
[19:29] *** belluzj joined
[19:32] *** tonyo left
[19:38] *** wayland76 joined
[19:39] *** wayland left
[19:45] *** tonyo joined
[19:52] *** tonyo left
[19:57] *** rmv left
[19:58] *** tonyo joined
[20:00] *** rmv joined
[20:03] *** silug left
[20:08] *** tonyo left
[20:09] *** tonyo joined
[20:11] *** silug joined
[20:13] *** hurufu left
[20:15] *** tonyo left
[20:20] *** tonyo joined
[20:24] *** tonyo left
[20:39] *** tonyo joined
[20:43] *** librasteve_ left
[20:45] *** tonyo left
[20:50] *** tonyo joined
[20:51] *** belluzj left
[21:01] <apogee_ntv> tonyo: Looks like fez upload is broken atm, has been for a few hours.

[21:01] <apogee_ntv> (rmv said you're the person to ping :D)

[21:10] *** tonyo left
[21:45] *** tonyo joined
[21:50] *** tonyo left
[22:12] *** tonyo joined
[22:20] *** tonyo left
[22:20] *** tonyo joined
[22:25] *** tonyo left
[22:26] *** tonyo joined
[22:31] *** tonyo left
[22:37] *** tonyo joined
[22:42] *** tonyo left
[22:43] *** wayland76 left
[23:01] *** tonyo joined
[23:14] *** tonyo left
[23:27] *** leppard|2 joined
[23:27] *** tonyo joined
[23:29] *** leppard left
[23:31] *** tonyo left
[23:45] *** tonyo joined
[23:50] *** tonyo left
[23:56] *** tonyo joined
