🦋 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 inspection is getting closer to beta. If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 25 August 2021.
Ergo444 hi 00:21
[Coke] hi 00:35
m: say (3/99).nude 00:36
camelia (1 33)
[Coke] ^^ is there a way to make that work without parens? some other way to force the precedence?
moon-child m: say .nude given 3/99 00:37
camelia (1 33)
moon-child ideally you would be able to say '3/99 .nude'. It works for negatives and complex numbers, but not fractions apparently
[Coke] heh. I literally had that typed out and was going to send it. :) 00:38
moon-child :)
japhb m: say 3/99\.nude # Curious 01:27
camelia No such method 'nude' for invocant of type 'Int'. Did you mean any of
these: 'NFD', 'Num', 'none', 'note'?
in block <unit> at <tmp> line 1
japhb Ah well
m: say 3/99\ .nude # Curious
camelia No such method 'nude' for invocant of type 'Int'. Did you mean any of
these: 'NFD', 'Num', 'none', 'note'?
in block <unit> at <tmp> line 1
japhb Well, so much for that idea
moon-child if you find angle brackets more to your liking than parenthesis, you can do 01:28
m: say <3/99>.nude
camelia (1 33)
moon-child (imo angle brackets are easier to parse, because their contents have limited lexical complexity; YMMV)
japhb m: say <3/99>.WHAT 01:37
camelia (Rat)
japhb m: say < 3/99 >.WHAT
camelia (RatStr)
japhb But be careful of that difference ^^
One is a Rat literal, the other is a string converted by val() to a RatStr
mcmillhj A bit confused about set operations, specifically inequality. In this gist, why is `$last` `(Any)`: gist.github.com/mcmillhj/a54ea1515...ae81218f74 04:46
moon-child != is numeric inequality, which I expect is not what you want 04:48
mcmillhj Both inputs are Sets so I thought it would use the Set inequality operator. It there some way that I need to indicate that I want that operator used? 04:50
moon-child !(==) is the set inequality operator 04:51
(or, really it is (==) that is the set equality operator, to which the ! metaoperator can be applied. But, potato potato) 04:52
mcmillhj ah whoops, I was misreading ≢ in the docs as != ... That's my mistake. Thanks for the help! 04:53
moon-child np
Ergo444 hi 07:52
TheAthlete Hello!
Ergo444 I have this problem... stackoverflow.com/questions/702864...-correctly 08:00
moritz_ I've answered on SO, hope it helps 08:09
Ergo444 I added more information 08:11
It is not that simple.
The program keeps running, doing stuff
The full output is printed when the program ends.. with a considerable delay. 08:12
Ergo444 I think it buffers the output.....for a while before printing 08:18
how to make it print more often?
moritz_ see my updated answer 08:19
Ergo444 ok 08:21
but if I run the program in itself... it does not delay that much. 08:22
moritz_ (having the discussion in two different places in parallel doesn't work well)
SmokeMachine m: say 3/99 .nude 08:23
camelia No such method 'nude' for invocant of type 'Int'. Did you mean any of
these: 'NFD', 'Num', 'none', 'note'?
in block <unit> at <tmp> line 1
moritz_ I don't think that the space lowers the precedence 08:25
Ergo444 saying the same thing everywhere 08:27
SmokeMachine moritz_: shouldn't it? it works for ^10 .max (or am I misremembering it?) 09:28
m: say ^10 .max 09:29
camelia 10
SmokeMachine m: say ^10 .min
camelia 0
SmokeMachine m: say ^10.min
camelia Potential difficulties:
Precedence of ^ is looser than method call; please parenthesize
at <tmp>:1
------> 3say ^107⏏5.min
^10
ab5tract hmm... is it curious that Bags don't have a median method? 12:25
Guest85 Hi All, 12:27
How would you solve this? 12:28
blogger.googleusercontent.com/img/...=w640-h370
m: <25 2 10 3 20 5 15 0>.combinations(3).grep: *.sum == 35;
camelia ( no output )
Guest85 That does not count multiple throws at the same dart board score. 12:29
Guest85 I got as far as: 12:29
m: say sort gather { 12:30
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3say sort gather {7⏏5<EOL>
Guest85   for ([X,] <25 2 10 3 20 5 15 0> xx 3) {
    take sort $_ if (sum $_) == 35;
  }
}
But that does not make the list unique and I'm struggling with 'with'.
ab5tract m: 34.5 .ceil 12:34
camelia No such method 'ceil' for invocant of type 'Rat'. Did you mean any of
these: 'Real', 'cis', 'perl', 'tail'?
in block <unit> at <tmp> line 1
ab5tract ^^^ LTA bug: .ceil should mention .ceiling :)
El_Che cis 12:35
lol
lizmat github.com/rakudo/rakudo/commit/57adbb1ef0 # ab5tract 12:55
aaah... it *is* 13:00
oops, ww
Geth ecosystem: c68d532e11 | (Elizabeth Mattijsen)++ | META.list
Text::Markdown now lives in the zef ecosystem
13:02
ab5tract lizmat: I had a feeling it wouldn't last too long :D 13:04
lizmat ab5tract: I wonder if there are many more of these false friends 13:06
do you know of any offhand that wouldn't be caught already ?
ab5tract lizmat not off the top of my head, no 13:25
Ergo444 Are threads safe to use with perl5 modules? 13:57
MasterDuke Ergo444: i believe so, but nine would know for sure 14:00
Ergo444 I encountered some problems 14:01
ab5tract Ergo444: IIRC you need to have Perl compiled with support for having more than one interpreter in memory 15:49
I forget the specific flag
El_Che -Dusethreads 15:52
ab5tract El_Che: I think it is actually separate from that flag, though the use of -Dusethreads implies/enforces the flag I'm thinking of. 15:54
I'm relatively confident that it is -Duseshrplib 15:56
ab5tract though looking at the docs here makes me question whether that is correct.. metacpan.org/dist/perl/view/INSTAL...rl-library 16:02
ab5tract as -Dusethreads doesn't mention anything about an associated performance penalty 16:02
ab5tract m: my @a = [[1,2,3],[4,5,6]]; @a.unshift: [0,0,0]; @a.append: [0,0,0]; dd @a 16:10
camelia Array @a = [[0, 0, 0], [1, 2, 3], [4, 5, 6], 0, 0, 0]
ab5tract why does append "un-array" my value?
m: my @a = [[1,2,3],[4,5,6]]; @a.unshift: [0,0,0]; @a.append: $[0,0,0]; dd @a 16:11
camelia Array @a = [[0, 0, 0], [1, 2, 3], [4, 5, 6], [0, 0, 0]]
ab5tract ok, so there is the solution.. but it feels like a WAT to me 16:11
[Coke] . 16:12
lizmat ab5tract: why use .append and not .push ?? 16:14
m: my @a; @a.push: [1,2,3]; dd @a 16:15
camelia Array @a = [[1, 2, 3],]
lizmat .append and .prepend where specifically created for their flattening behaviour
ab5tract lizmat: doh! that was a total thinko on my part. of course .push is the corresponding method for .unshift 16:21
lizmat ok, glad to be able to clear that up :-)
ab5tract lizmat: much appreciated :D 16:22
lizmat the reason that .push doesn't have single arg semantics
is whether @array.push(@array.pop) should restore the array in the original state regardless of the contents of the last elemen 16:23
t
ab5tract lizmat++ thanks for the explanation 17:01
merryprog Hey lizmat, do you know where the regex engine is implemented? Looking to make a bugfix or positive lookbehinds 17:43
my code search-fu isn't turning up where the main logic happens 17:44
moon-child merryprog: github.com/Raku/nqp/tree/master/src/QRegex 17:45
merryprog ah that'd be why :P was looking in Rakudo
thank you!
merryprog yay my rakudo installation is broken 🙃 20:58
raku repl wasn't working, homebrew uninstalled rakudo-star, homebrew installed rakudo, now errors with "Unhandled exception: Missing or wrong version of dependency 'gen/moar/stage2/MASTNodes.nqp' (from 'gen/moar/Pod.nqp')" 20:59
(Raku repl wasn't working = no prompt would ever appear and didn't respond to input)
tonyo merryprog: what is the bug with positive lookbehinds? 21:01
merryprog tonyo variable interpolation in a positive lookbehind will effectively reverse the argument 21:02
m: my $num = 12; say S:g/<?after $num>/!/ with "12 21"; say S:g/<?after 12>/!/ with "12 21"
camelia 12 21!
12! 21
merryprog what seems to be happening is it reverses the ast (or something magical, I don't really know) when doing a lookbehind but for some reason it doesn't compare the interpolated reversed during that comparison 21:03
lizmat merryprog: that feels like a known issue, fwiw 21:08
merryprog oh. Checked the issue tracker but didn't see it.
lizmat maybe in nqp ?
merryprog yeah
Looks like the lookbehind stuff is a bit WIP considering its test suite is commented out :P
lizmat could very well be
merryprog If it is known/WIP then I won't bother looking into this more—I underestimated how scary AST combined with Regex parsing would be... 21:11
[Coke] We should make sure there's a bug open, probably 21:12
anyone else having issues with AOC Day 8, Part 2 (no spoilers) 21:13
(I solve the sample data, but not the real data)
MasterDuke merryprog: there was some chat about that bug over in #moarvm last night logs.liz.nl/moarvm/2021-12-08.html#21:25 21:21
merryprog oh nice, you beat me to it :)
MasterDuke well, i haven't fixed anything
feel completely free to beat me to that 21:22
merryprog well you actually know what you're doing...
MasterDuke ha, almost entirely untrue when it comes to the grammar/regex implementation 21:23
merryprog pfft
japhb I knew MasterDuke was going to say something like that, but it ruins the humble if someone else says it for them. ;-) 21:28
MasterDuke heh. wish i was exaggerating the humbleness, but not the case this time 21:29
tonyo m: m: my $num = 12; say S:g/<?after "$num">/!/ with "12 21"; 21:31
camelia 12 21!
tonyo oop
ggoebel coke: I was able to solve AOC day 8 part 2. can you share your input? and answer? I'll run code against it and let you know if I get the same result (no spoilers) 21:58
hobbs gist.github.com/arodland/b433602c1...e295e0374a -- advent of code day 8 (yesterday) in raku. Mildly untidy but Raku made a decent fit 22:23
elcaro OH! When was slippy semilist (`@m[||@xy]`) added to v6.e.PREVIEW ?! I'm sure it didn't work last time I tried 22:26
elcaro Which admittedly was probably 12 months ago 22:26
elcaro To which I mean... I know it was added to Associatives a while back (`.{||@keys}`), but I'm sure I tried it on an Array at the time and it didn't work 22:28
[Coke] ggoebel: found the bug in my algo. Just got lucky on the sample data. 23:29
[Coke] (my bug depended on the order of digits on the LHS) 23:46