🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | 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 8 June 2022.
00:07 reportable6 left 00:08 reportable6 joined 00:20 mira left 00:59 dogbert11 left 01:38 Sankalp- joined, Sankalp left, Sankalp- is now known as Sankalp 01:48 dogbert11 joined 01:54 frost joined 02:54 sourceable6 left, greppable6 left, tellable6 left, coverable6 left, benchable6 left, releasable6 left, quotable6 left, committable6 left, linkable6 left, bisectable6 left, shareable6 left, unicodable6 left, statisfiable6 left, nativecallable6 left, reportable6 left, notable6 left, evalable6 left, bloatable6 left, quotable6 joined, reportable6 joined, shareable6 joined, statisfiable6 joined, nativecallable6 joined 02:55 notable6 joined, unicodable6 joined, bloatable6 joined 02:56 tellable6 joined, linkable6 joined, greppable6 joined, coverable6 joined, benchable6 joined 02:57 sourceable6 joined, releasable6 joined, committable6 joined, evalable6 joined, bisectable6 joined 03:07 frost left 03:17 frost joined 04:17 bloatable6 left, evalable6 left, greppable6 left, statisfiable6 left, linkable6 left, benchable6 left, notable6 left, unicodable6 left, coverable6 left, reportable6 left, tellable6 left, committable6 left, shareable6 left, quotable6 left, releasable6 left, nativecallable6 left, sourceable6 left, bisectable6 left 04:18 shareable6 joined, quotable6 joined, releasable6 joined, bisectable6 joined, unicodable6 joined, benchable6 joined, nativecallable6 joined, bloatable6 joined 04:19 linkable6 joined, statisfiable6 joined, greppable6 joined, committable6 joined, reportable6 joined, evalable6 joined 04:20 notable6 joined, tellable6 joined, sourceable6 joined, coverable6 joined 05:20 reportable6 left, coverable6 left, bloatable6 left, benchable6 left, releasable6 left, sourceable6 left, shareable6 left, bisectable6 left, statisfiable6 left, linkable6 left, quotable6 left, nativecallable6 left, tellable6 left, evalable6 left, committable6 left, notable6 left, greppable6 left, unicodable6 left 05:21 greppable6 joined, bloatable6 joined, shareable6 joined, releasable6 joined, coverable6 joined, reportable6 joined 05:22 linkable6 joined, bisectable6 joined, tellable6 joined, notable6 joined, evalable6 joined, sourceable6 joined, statisfiable6 joined 05:23 quotable6 joined, benchable6 joined, unicodable6 joined, committable6 joined 05:24 nativecallable6 joined 06:03 Voldenet_ joined 06:04 Voldenet left, Voldenet_ is now known as Voldenet 06:08 reportable6 left 06:10 reportable6 joined 06:24 abraxxa joined 06:32 abraxxa left, abraxxa joined 07:08 Sgeo left 07:29 Nemokosch joined
Nemokosch m: dd (9, ) >>**>> (1 .. *) 07:30
camelia (9,)
Nemokosch m: dd 9 >>*>> (1 .. *)
camelia List on right side of hyperop of infix:<*> is known to be infinite
in block <unit> at <tmp> line 1
Nemokosch My question is simple: _why_
why does it fail when the generating end is one single element 07:31
07:31 Nemokosch left
lizmat Nemokosch: probably some trait on the operator 07:59
tellable6 lizmat, I'll pass your message to Nemokosch
Nemokosch I'm pretty sure this is either a bug or not documented 08:01
It should simply take the lhs value and use it like in the first, one-element list case
lizmat tend to agree with you 08:09
08:13 sena_kun joined
Nemokosch is there something like divmod? seems like I overestimated the usefulness of polymod 08:14
[18] > 92.polymod(1,2,6,24,120,720) 08:28
(0 0 4 7 0 0 0)
this result makes no sense anyway
what is that 7?
> In the first case, 120 is divided by 10 giving as a remainder 12, which is the last element. 08:30
it's not the remainder, it's the quotient... could this be comprehensible...
lizmat you'd have to ask Larry, as he came up with it and implemented it, afaik :-) 08:38
Nemokosch it does the opposite of what I'd like to have, apparently 08:41
the description could be better either way
lizmat doc PR's are always welcome! 08:42
Nemokosch what it seems to do is -> returns $n mod $current and replaces $n with $n div $current for the next calculation 08:43
92 mod 1 is 0, 92 mod 2 is also 0, 46 mod 6 is 4, 7 mod 24 is 7 and from that point on, $n reached 0
what I would actually need is the opposite 08:45
returning the div and calculating further with the mod
of course then it would be fed in reverse order
92 div 720 is 0, 92 div 120 is still 0, 92 div 24 is 3, 20 div 6 is also 3, 2 div 2 is 1 and $n reached 0 08:47
Voldenet polymod is useful for converting ints into human readable output 08:54
m: say reverse (123412346435).polymod(1024 xx Inf) Z~ <b k M G T>
camelia (114G 959M 189k 579b)
Nemokosch theoretically yes, practically it could be much better, frankly 08:59
the "polydiv" function I described would give the same result AND would work for my use case as well
Voldenet so… you want to turn 92 into (3 3 1)? 09:00
m: say 92.polymod(1..5).reverse
camelia (0 3 3 1 0 0)
Voldenet something like that
Nemokosch this looks merely coincidental, though. It should be 0 0 3 3 1 0 09:01
Voldenet starting from 720, eh
m: say 92.polymod(1..6).reverse
camelia (0 0 3 3 1 0 0)
Nemokosch other than that I don't see how 1..5 relates to descending factorials 09:02
I guess this is some algebraic identity at the end of the day 09:04
I'm not sure if polymod can always fake "polydiv" this way 09:06
also this is considerably less readable with regards to the problem
Voldenet Yes, it is considerably less readable 09:07
Nemokosch I'm counting factorials because I want to identify a permutation
I could imagine a combinatoric problem where the countings for consequent number of elements don't divide each other 09:09
Voldenet Yes, this will produce unique sequences for substantially large numbers I think 09:10
Nemokosch for the factorials, indeed it looks like this will give the right result, which is cool some way 09:12
Voldenet you can see polymod as representation of positional systems also 09:13
m: say 16.polymod(16 xx 5).reverse
camelia (0 0 0 0 1 0)
Voldenet m: say 64.polymod(16 xx 5).reverse
camelia (0 0 0 0 4 0)
09:13 linkable6 left, evalable6 left
Voldenet m: say 256.polymod(16 xx 5).reverse 09:13
camelia (0 0 0 1 0 0)
Nemokosch still I think 1. polymod should get a better description, perhaps with even more example usages 2. it would make sense to have a polydiv, if for no other reason, for the more transparent interface 09:14
09:14 evalable6 joined 09:16 linkable6 joined
yes, and I have the impression that as long as the given divisors, idk the mathematical term but all divide the previous divisors, polymod and polydiv do the same thing but backwards 09:16
Voldenet m: say ((((((4 * 3) + 3) * 3) + 1) * 2) + 0) * 1 09:19
camelia 92
lizmat PR's are welcome :-)
Nemokosch you know what is the other notoriously sadistic method? 09:20
Voldenet my fav still is ^fff^ operator 09:21
when I see it in the code, i hang for a few seconds
Nemokosch I tried to look into those, too 09:22
but I succeeded even less than with the toggle method
sometimes it's good to make a from-predicate-to-predicate cut on an infinite sequence
and toggle kinda sorta lets you do that
still I wouldn't say it's an optimal tool... 09:24
simply because the semantics isn't terribly suited for either this or any other problem I can think of
Voldenet m: for ^50 { .say if !.is-prime ^fff^ .is-prime } 09:26
camelia 1
Nemokosch blogs.perl.org/users/zoffix_znet/20...tions.html this post about polymod is pretty good btw
especially the "handmade" part I think 09:27
it actually says how it works
Voldenet I just remember it as seconds-to-date-algorithm, there's only one way to write that correctly 09:28
Nemokosch well, that's a good start to interpolate 🤠
What bothers me about it is that it's really used as a fake "polydiv" when most of the time we would care about the div values indeed 09:30
> m: say reverse (123412346435).polymod(1024 xx Inf) Z~ <b k M G T>
this was a really good illustration
we care about how many times the unit _is filled_, not _what is left_ 09:31
it's just a nice side effect that answering "what is left" is a way to the other question
Voldenet writing good docs for this may be surprisingly difficult 09:32
even though it's such a simple method
Nemokosch This is like Horner's division
like okay it's nice and elegant to write it from small numbers and the modulus towards the bigger numbers 09:33
but we are still interested in the quotients, starting from the big numbers
and if you have those braindead anglo-saxon units of measure that may not even divide each other 09:34
the Horner way may even fail
Voldenet with non-SI units you may also need to know current moonphase or length of user's beard (if present) 09:35
09:37 frost left
Nemokosch 🤣 09:38
anyway, there may be situations where you can't rely on the mods turning into divs
and frankly I don't know when you'd want actually the mods
10:31 dogbert11 left 10:54 frost joined 11:00 dogbert11 joined 11:05 sacomo left
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2022/07/18/2022-29-hot/ 11:07
frost lizmat++ 11:08
lizmat pretty cool, thank you :-) 11:09
11:16 sacomo joined 11:26 dogbert11 left, dogbert11 joined 11:47 dogbert11 left 12:06 dogbert11 joined 12:08 reportable6 left 12:09 reportable6 joined 12:14 dogbert17 joined 12:16 dogbert11 left 12:21 dogbert17 left, jgaz joined 12:35 dogbert17 joined 13:04 jgaz left, m6502 joined 13:21 dogbert11 joined, dogbert17 left 13:34 m6502 left, jgaz joined 13:38 Nemokosch joined
Nemokosch test test 13:40
tellable6 2022-07-18T07:59:12Z #raku <lizmat> Nemokosch: probably some trait on the operator
Nemokosch is wondering 13:41
it worked, lol
13:42 Nemokosch left 13:43 Nemokosch joined, Nemokosch left, Nemokosch joined
lizmat wonders what it is that worked 13:43
13:44 Nemokosch left, Nemokosch joined
Nemokosch same but backwards... 13:44
lizmat ah, an irc to discord bot ? 13:45
13:45 Nemokosch left
Nemokosch I was just curious if Pidgin would support this ACTION stuff 13:47
[Coke] stackoverflow.com/questions/729453...de-warning - doesn't the suggestion here mean that when the deprecated thing is removed, the code will then stop working? 14:11
(as opposed to changing the code to avoid the deprection warning) 14:12
14:15 Sgeo joined
lizmat [Coke]: I guess hhmmmm 14:21
[Coke] ok. added a comment. Thanks 14:24
docs say "Rakudo provides a separate set of executables suffixed with a 'w' (rakuw.exe, rakudow.exe, ...) that are compiled as non-console applications. These do not spawn this console window. 14:26
but if I run "rakuw -e 'say 3'", it does output it.
14:33 Xliff left 14:36 grondilu joined
grondilu m: grammar { token TOP { \# } } 14:37
camelia ===SORRY!===
Regex not terminated.
at <tmp>:1
------> grammar { token TOP { \# } }⏏<EOL>
Regex not terminated.
at <tmp>:1
------> grammar { token TOP { \# } }⏏<EOL>
Malformed regex
at <tmp>:1
------> grammar…
tellable6 2022-05-23T23:55:55Z #raku <Xliff_> grondilu: Donno. But sticking a guard on that would effectively kill the Failure.
grondilu m: grammar { token TOP { '#' } }
camelia ( no output )
grondilu m: grammar { token TOP { \\# } } 14:38
camelia ===SORRY!===
Regex not terminated.
at <tmp>:1
------> grammar { token TOP { \\# } }⏏<EOL>
Malformed regex
at <tmp>:1
------> grammar { token TOP { \\# } }⏏<EOL>
grondilu I thought I could backslash # like with any metacharacter 14:39
m: grammar { token TOP { \% } }
camelia ( no output )
grondilu looks like a bug tbh
btw it works fine in a regex 14:40
m: say "#" ~~ /\#/
camelia 「#」
15:23 abraxxa left 15:25 abraxxa joined 15:29 frost left 16:15 grondilu left 16:25 japhb left 16:28 lichtkind joined 16:32 japhb joined
SmokeMachine m: my Pair $a = abc => 42; multi bla(Pair (:$key, |)) { say $key }; bla $a # this works... 17:11
camelia abc
SmokeMachine m: my Pair $a = abc => 42; given $a { when Pair (:$key, |) { say "bla" } } # Should this also work? 17:12
camelia ===SORRY!=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> air $a = abc => 42; given $a { when Pair⏏ (:$key, |) { say "bla" } } # Should thi
expecting any of:
block or pointy block
SmokeMachine m: my Pair $a = abc => 42; given $a { when :(Pair (:$key, |)) { say "bla" }; default { .say } } # This does not die... 17:20
camelia abc => 42
17:32 linkable6 left, evalable6 left 17:34 linkable6 joined, evalable6 joined 18:07 reportable6 left 18:10 reportable6 joined 18:26 eseyman joined
SmokeMachine is there a better way of doing something like this? usercontent.irccloud-cdn.com/file/...6%402x.png 18:28
lizmat m: role Maybe[::T = Int] { } 18:33
camelia ( no output )
lizmat assuming role Maybe { } has Int as a default for T ? 18:34
SmokeMachine I don't know if it should have a default... 18:37
lizmat then what is the role of role Maybe without T ? 18:39
18:39 dogbert17 joined
SmokeMachine just for be able to use Maybe without [T] on pattern matching 18:39
18:41 dogbert11 left
lizmat m: role Maybe[::T?] { } 18:41
camelia ===SORRY!=== Error while compiling <tmp>
Malformed parameter
at <tmp>:1
------> role Maybe[::T⏏?] { }
expecting any of:
formal parameter
lizmat m: role Maybe[::T = Any] { }
camelia ( no output )
lizmat that should allow it?
SmokeMachine lizmat: yes, thanks! usercontent.irccloud-cdn.com/file/...2%402x.png 18:43
lizmat yuu're welcome :-) 18:45
18:59 dogbert11 joined 19:01 dogbert17 left 19:02 melezhik joined
melezhik hi jjatria - did you get a chance to take a look at postfix + Tomtit PR? 19:06
19:07 xinming left 19:09 xinming joined 19:13 rypervenche left 19:24 melezhik left 20:11 abraxxa left 20:23 Kaiepi left 20:24 rypervenche joined 20:45 dogbert11 left, dogbert11 joined 20:56 dogbert11 left 20:59 dogbert11 joined 21:06 Kaiepi joined 21:10 jgaz left 21:12 dogbert11 left 21:14 dogbert11 joined, sena_kun left 22:03 dogbert17 joined 22:05 dogbert11 left 22:28 discord-raku-bot left 22:29 discord-raku-bot joined 22:38 discord-raku-bot left 22:39 discord-raku-bot joined 22:40 habere-et-disper joined
habere-et-disper Z appears to have a default of the list constructor Z, (Z comma) 22:41
Should R have the same (it appears to not have a default)
? 22:42
23:40 evalable6 left, linkable6 left 23:42 evalable6 joined, linkable6 joined 23:45 [Coke]_ joined 23:46 [Coke] left