🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku
Set by ChanServ on 14 October 2019.
sena_kun El_Che, there is a point release out. 00:02
xinming Is freenode being attacked? I got many PM from different people. 02:35
perry Gibberish orrrrr? 02:36
I just realized I had +R set when I didn't want it, whoops.
Well, if you do /mode <yournick> +R you won't get any PMs from unregistered people. 02:37
leont Yeah 02:43
tonyo rba: i did to find out why zef: was 404ing but the problem's since been corrected and the logs aren't needed (by me, anyway) 02:46
guifa2 codesections++ 02:54
codesections sorry it took so long :D 02:55
guifa2 Haha 'sok. I've been busy reformating CLDR again again (although this time more just tinier touchups) 02:57
haha
codesections ha. Somehow I feel like that's an all-purpose reply for you, no matter when :) 02:58
guifa2 I mean … yes :-) 02:59
But no lie, a project of this scope has meant I've learned a *lot*
codesections I bet! 03:00
guifa2 that's where the idea of the FOSDEM presentation came out of — I'm writing a module that I have to use to write other moduels that I need to write the one that started this whole danged journey … so I'm constantly thinking how to improve the links between them 03:01
codesections also, part of the strength of Raku's concision is that it makes it a lot easier to rewrite code (in the spirit of programmingisterrible.com/post/139...ge-systems or similar) 03:02
guifa2 I've been really enjoying using traits lately. I was able to cut out about a hundred lines of code by rewriting them as traits on attributes 03:03
codesections O.O I need to do more with traits 03:04
guifa2 I had a lazy loader
has $!foo; method foo { .return with $!foo; …………………… $!foo = finish-loading-for(FOO_OFFSET) }  03:05
it's a pattern I've used before and it works nicely if you just have one or two methods like that, but by the time I got to the 12 attribute …
has $!foo is lazy; # done
codesections nice :) 03:06
leont The recent haskellish code question reminded me I had some almost finished code doing just that 03:17
So now it works, and all that's between me releasing an Erlang style actor model module is writing documentation…
guifa2 leont: did you see gfldex's blog post on it? 03:19
leont Yeah 03:20
xinming perry: Thanks 03:21
guifa2 when I saw it I was like "this is exactly what I was talking about at FOSDEM" haha
leont The whole «Hold (:$key) {}» trick was new to me.
As in, named destructuring like that was a bit surprising, but quite useful 03:22
codesections .ask guifa very cool. One thing I haven't gotten my head around, though, with traits is when to use a new variant of `is` vs a new trait altogether. E.g., could you have replaced `multi sub trait_mod:<is> (Attribute \attr, :$lazy)` with `multi sub trait_mod:<lazy> (Attribute \attr)`? Or would that not work? If it does work, is there a reason to prefer one to the other? (Other than choosing between calling it with `is lazy` vs 08:05
`lazy`, I mean)i
tellable6 codesections, I'll pass your message to guifa2
gfldex lolibloggedalittle: gfldex.wordpress.com/2021/02/25/custom-when/ 09:04
codesections gfldex++ “Raku is a highly composable programming language, where things just fall into place” sounds a lot like the theme from guifa's Surprisingly Unsurprising talk at Fosdem: so many things fit perfectly together, not b/c anyone planed for that _in particular_ but because the underlying primitives are so carefully planed. It's great :D 10:08
gfldex codesections: planned as in "iterated for 10 years until all the edge-cases have worn off"? 10:09
codesections haha, yeah, that :) 10:10
I guess it's easy for me to show up post the "Raku" rename, and view the language as a magnificent jewel of design... skipping over the 10+ years of hard work iterating on that design! 10:12
(On the other hand, a _lot_ of Raku's great ideas were already present in the Synopses, so :shrug: ) 10:14
codesections I'm clearly forgetting something basic. How do I dwim here: 10:32
m: my &f = &g // { 'default' }
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
g used at line 1
gfldex m: my &f = MY::<&g> // { default }; f; 10:37
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3my &f = MY::<&g> // { default 7⏏5}; f;
expecting any of:
scoped block
gfldex m: my &f = MY::<&g> // { 'default' }; f;
camelia ( no output )
gfldex m: my &f = MY::<&g> // { say 'default' }; f;
camelia default
gfldex m: sub g { say 'oi‽' }; my &f = MY::<&g> // { say 'default' }; f;
camelia oi‽
gfldex codesections: ^^^ 10:38
codesections oh, thanks. That was... not as basic as I was thinking I was missing!
ty
I guess &MY::g also works, and helps the line-noise factor a bit :) 10:39
gfldex it wasn't basic because a bare `g` is a compile time thing and calling `//` happens at runtime. I believe Rakus partly runtime partly compiletime nature makes it hard on beginners.
codesections yeah. I've *mostly* crossed that hurdle, though I clearly still get tripped up a bit 10:40
it's when we start nesting compiletimes and runtimes, that I'm in serious danger! 10:41
sxmx m: for 1..10 { put $_ ** 3 } 10:43
camelia 1
8
27
64
125
216
343
512
729
1000
codesections here's a question that has me stumped, even though it seems like it should have an easy answer: 12:25
the docs provide this example for an async socket: whenever $conn.Supply.lines -> $line { #`(block) } 12:26
how do I do the same thing, but for $n bytes at a time (instead of one line at a time)
with a regular socket, I'd use .read 12:27
but that isn't available here. My first thought was to use .head($n), but that seems to give the first $n packets (or Blobs?), not the first $n bytes 12:28
Altreus do you have to create $conn in a special way so it knows to deliver bytes? 14:27
codesections yeah, I've actually done that -- you do $conn.Supply(:bin) 14:29
(I went a different direction, so I'm not actually going to use bytes in that way -- I haven't been stuck on it for 2+ hours :D But I'm still curious to know what I was missing for future reference) 14:30
Altreus It's a supply bin 14:42
it contains 1 wool tuque and 1 mouldy chocolate bar
rir This is my friendly interface for wrapping utimensat: 15:22
touch( Str:D $fn, Instant :access($a), Instant :modify($m), Boolean :NOFOLLOW($b) )
Where the default for absent Instants is now and Instant:U args mean no change.
Good? Bad?
guifa2 hmm, I agree that no instant should be now, that seems like the most common use case anyways 15:31
tellable6 hey guifa2, you have a message: gist.github.com/70cd76fbc93ac94b40...f059abebcc
guifa2 codesections: right now I don't think there's a way to do a trait other than with "is" 15:36
Although clearly the groundwork is layed for me to be able to do trait_mod:<contains> (Mu \positional, :$type-name), it's just not there yet 15:38
codesections guifa2: interesting! I guess the docs are wrong (or just set in the future…) 15:40
guifa2 at least, I've not been able to create a trait using anything other than trait_mod:<is> 15:41
codesections «[A trait] is declared with the trait_mod declarator followed by a colon and a string literal containing the name of the trait»
guifa2 oof, yeah that seems off. 15:42
lizmat: thoughts? You write more traits than anyone else :-)
codesections m: multi sub trait_mod:<bar>(Sub $s) { note }; sub qux() bar { say 42 }
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3it_mod:<bar>(Sub $s) { note }; sub qux()7⏏5 bar { say 42 }
expecting any of:
new name to be defined
BBBB Is there an updated repo for github.com/stmuk/pl6anet.org/ ? Raku.org homepage lists recent posts from that site and I want to remove a site from it but trying to submit a PR on that repo says I can't because it's archived. 16:24
I wanted to remove perl6.party from the list. It no longer posts new Raku articles and might very soon contain non-Raku, non-programming articles, which will be weird for them to show up in the pl6anet.org feed and raku.org home page that pulls from that feed. (ping moritz if you know maybe where to remove it) 16:31
MasterDuke github.com/Raku/planet.raku.org i believe 16:36
PimDaniel Is there a math symbol in raku for relative complement: A \ B means : all elements of A that are not into B. Thank's. 18:17
jmerelo PimDaniel: that one precisely. Try it out. You need to use an unicode slash, though 18:22
PimDaniel ho ho . 18:24
PimDaniel jemerelo. Sure? i cannot see it into the reference. 18:27
But the problem is i may be i can't write unicode. 18:28
guifa2_ docs.raku.org/language/setbagmix#i..._%E2%88%96
you can use (-) or ∖
PimDaniel Okay!!! Thank's !
PimDaniel thank's jmerelo, maths work! 18:49
I translated from python HopcroftKarp algorithm class to raku class. 18:50
PimDaniel Then i'm calculating the Maximum Independant Set for bipartit graph in order to make retilinear polygons coverage. 18:52
*rectilinear
Is there somebody here good at maths because i doubt for just a thin part. 18:54
????
even for tomorrow. :))) 18:55
PimDaniel The problem does not concern Hopcroft and Karp algorithm : class est prepared to be published, but on the calculation of what thez call alternated paths. 18:57
SmokeMachine I think this is what we need to do to remove the WiP from Red's description (github.com/FCO/Red/issues/470#issu...86132637). What do you guys think? Is someone wanting to help? 19:08