🦋 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.
rypervenche I'm doing a .map on an array and I'd like to do something different for the first element than for the rest. Is there a better way to do this than to have a counter and check if it's == 1? 01:04
guifa2 not only having a counter, but you really need to be doing that with @array.kv.map 01:26
I don't think there's a guarantee that maps are processed in order
m: <a b c d e>.kv.map( -> \k, \v { if k == 1 { "one" } else { v } } ) 01:27
camelia ( no output )
guifa2 m: say <a b c d e>.kv.map( -> \k, \v { if k == 1 { "one" } else { v } } ) 01:28
camelia (a one c d e)
guifa2 rypervenche: see above 01:28
rypervenche Ooh, no need for a counter then. I could just do a, if k == 0 01:34
guifa2 hrm 01:50
m: loop (my $i = 0; $i < 2; $i++) { print $i }; loop (my $i = 0; $i < 2; $i++) { print $i };
camelia Potential difficulties:
Redeclaration of symbol '$i'.
at <tmp>:1
------> 3 $i < 2; $i++) { print $i }; loop (my $i7⏏5 = 0; $i < 2; $i++) { print $i };
0101
guifa2 m: loop (my $i = 0; $i < 2; $i++) { print $i }; say $i; loop (my $i = 0; $i < 2; $i++) { print $i }; 01:51
camelia Potential difficulties:
Redeclaration of symbol '$i'.
at <tmp>:1
------> 3 $i++) { print $i }; say $i; loop (my $i7⏏5 = 0; $i < 2; $i++) { print $i };
012
01
guifa2 o.O
That's… something that will get some folks coming from other languages 01:52
guifa2 does a dance 06:46
I finally got epochtime -> localtime given an olson ID. Even handlees leap seconds :D
moritz rypervenche: great! Let me know what you think about it 07:15
Geth advent: 429e93de8d | (Moritz Lenz)++ | 20th/articles/rfc112.md
Language and markup fixes
07:22
advent: f2d5649c9b | (Moritz Lenz)++ | 20th/articles/rfc112.md
Fix typo
07:23
Geth ecosystem: a4b0359f3e | (Wenzel P. P. Peppmeyer)++ (committed using GitHub Web editor) | META.list
add Shell::Piping
07:35
ecosystem: 224aa12677 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | META.list
Merge pull request #521 from gfldex/patch-5

add Shell::Piping
moritz JJMerelo: re RFC advent, do I need to take care to publish my stuff, or will you do that? 08:14
JJMerelo moritz please do it yourself. I can help you if you want, but you know the ropes already
moritz JJMerelo: for which day? 08:15
JJMerelo moritz day 3. 08:17
I'll ask Altai-man_ to program theirs for today
.tell Altai-man_ can you please program your post for today 1 minute after midnight? 08:18
tellable6 JJMerelo, I'll pass your message to Altai-man_
moritz JJMerelo: roger, post scheduled 08:22
JJMerelo Thanks!
BTW, we're talking about the "20th anniversary calendar", started today rakuadventcalendar.wordpress.com/2...1-threads/
moritz JJMerelo: I'm pretty sure threads arrived in Perl 5 earlier than 5.10; I remember experimenting with them in 5.8.8 08:24
maybe even 5.6 had them
JJMerelo moritz Maybe 5.8.8 was what I'm talking about
I'll edit that 08:25
BTW, just change the address to raku-advent.blog, which was donated by tbrowder
moritz changed to 5.8.8, thanks! 08:26
JJMerelo BTW, we still need a dozen authors for the advent calendar github.com/Raku/advent/tree/master/20th Please claim an RFC, and add yourself there. 08:38
tobs I feel like I should write another one, but for a short and sweet and implemented feature. 09:05
mst JJMerelo: 5.005 had what are now referred to as, well, 5005threads, then 5.6 switched to the ithreads model based on activestate's work emulating fork on win32 09:06
hmm
I'm sure -something- happened in 5.6
but threads.pm itself went into core for 5.7.3
leont ithreads in 5.6 was only used for pseudoforking
mst ah, and Thread.pm and the 5005thread model was still all you got for threading? 09:07
leont Yeah
5.005 threads was closer to raku's threading model, except the interpreter wasn't thread-safe at all. This wasn't workable at all.
mst here we go: perldoc.pl/Thread#HISTORY
right, 5.005threads were "what we would've liked to have except lolno" 09:08
leont This is also why I was so upset with the Parrot people. They wrote a brand new VM, and didn't make it threadsafe from the start
mst ithreads were "what actually worked given the constraints"
leont ithreads kind of suck, but they were realistic
That decision in parrot was so dumb I can only describe it as incompetent. 09:09
mst right, and IME I don't manage to segfault them noticeable more often than I do single threaded perl
leont It's the thing that doomed it to never going to work
mst every time I looked at parrot it seemed to be in a new state of "we're rewriting everything from the ground up, get back to us" 09:10
eventually I stopped checking
leont Whereas in MoarVM it was thread-safe from the ground up. In particular the GC. 09:12
moritz it seems that projects that start with the premise of rewriting everything from scratch attract people who want to rewrite everything from scratch :D 09:13
nige thanks AlexDaniel++ 09:58
tbrowder JJMerelo: is the 20th advent meant to be published starting 1 dec, and you're trying to get early commitment (with words) to avoid last minute panic, etc.? 11:41
leont No it's this month 11:51
gfldex lolibloggedalittle: gfldex.wordpress.com/2020/08/01/dr...placement/ 12:12
Xliff [08:17:22] <Xliff> \o 12:19
[08:17:40] <Xliff> Does raku support C-like escape codes?
[08:17:53] <Xliff> What is the equivalent of "\x0000"?
[08:18:17] <Xliff> Or any of the octal codes?
Xliff m: 0o303.say 12:22
camelia 195
Xliff m: 0o303.fmt('%x').say
camelia c3
Xliff m: 0o244.fmt('%x').say 12:24
camelia a4
arbol Is there an opinionated Raku code formatter? 13:39
Also looking for a linter/static analysis tool 13:41
sena_kun No separate tool, but Comma partly solves this. 13:44
And likely more tools to come once recent re-work of compiler frontend will land.
arbol Neat thanks! I'm using VSCode but I might have to check this out too 13:47
masak yes, RakuAST would be a great starting point for a code formatter 14:01
tellable6 hey masak, you have a message: gist.github.com/517c579b2ffc70dabf...82f7586abc
masak I have a message... in a gist. go figure.
masak (hi #raku) 14:04
tadzik hi o/ 14:05
guifa2 Arg 15:24
Finally get my localtime functions to work and now I can't get the wrapping on DateTime to go 15:25
Is there a way to, when wrapping a function, also add additionally arguments to it? 15:27
m: class A { method foo { "bar" } }; A.^find_method('foo').wrap( method ($a) { 'foo' ~ callsame ~ $a }); say A.new.foo; 15:28
camelia Too few positionals passed; expected 2 arguments but got 1
in method <anon> at <tmp> line 1
in block <unit> at <tmp> line 1
guifa2 So not enough arguments there but…
m: class A { method foo { "bar" } }; A.^find_method('foo').wrap( method ($a) { 'foo' ~ callsame ~ $a }); say A.new.foo('xyz')
camelia Too many positionals passed; expected 0 arguments but got 1
in method <anon> at <tmp> line 1
in block <unit> at <tmp> line 1
guifa2 Now we've got too many =\
guifa2 Basically, it seems like when you wrap a function, the signature restraints are still imposed and can result in die messages when (I don't think) there should be 15:32
gfldex guifa2: you are doing callsame on a method that doesn't want any arguments
m: class A { method foo { "bar" } }; A.^find_method('foo').wrap( method ($a) { 'foo' ~ callwith() ~ $a }); say A.new.foo('xyz') 15:33
camelia Too few positionals passed; expected 1 argument but got 0
in method foo at <tmp> line 1
in method <anon> at <tmp> line 1
in block <unit> at <tmp> line 1
guifa2 I was just about to type it doesn't change with callwith =\
I'm trying to add a named argument to DateTime's new() but at runtime it always balks when it sees the new one 15:35
gfldex guifa2: when wrapping things, sometimes a BEGIN helps. 15:36
guifa2 hmm, hopefully that won't muck with precompilation 15:37
whelp, actually that didn't help =\ still getting unexpected named parameter 15:38
gfldex guifa2: in that case you might need INIT
JJMerelo .tell moritz I've moved your post up to this AM, since it was the next one that seemed to be ready. 15:45
tellable6 JJMerelo, I'll pass your message to moritz
guifa2 ugh, I might need a new approach entirely. I wanted to use wrap so I could stay in runtime and not breakprecompilation but i'm not sure if this is by design or an error 15:46
JJMerelo .tell Altai-man_ Please confirm that you can schedule the post tomorrow, or allow me to post it myself.
tellable6 JJMerelo, I'll pass your message to Altai-man_
Altai-man_ JJMerelo, you can freely post it, if it seems worthy. I plan to also write another one, but maybe a bit later this weekend, need to rest first. 15:47
tellable6 2020-08-01T08:18:07Z #raku <JJMerelo> Altai-man_ can you please program your post for today 1 minute after midnight?
JJMerelo Altai-man_ great to hear that. Thanks! 15:48
Altai-man_ Thanks for doing the posting trickery for me.
moritz JJMerelo: ACK 15:54
JJMerelo Altai-man_ done, scheduled for motrow night. I've set it to your authorship, just in case you want to dive in and make some last-minute changes. 16:01
Altai-man_ JJMerelo, thanks! Thanks for organizing all this. 16:02
JJMerelo Altai-man_ thanks for participating. It's a nice article :-) 16:03
Geth doc: 89863b9baa | (JJ Merelo)++ | doc/Language/5to6-perlfunc.pod6
Fixes link to proceed/succeed, closes #1089
16:38
linkable6 Link: docs.raku.org/language/5to6-perlfunc
DOC#1089 [closed]: github.com/Raku/doc/issues/1089 [docs][search] proceed succeed should be split in search
Geth advent: a83fd9131c | (Tobias Boege)++ | 20th/articles/rfc145.md
Add summary to RFC 145 article
21:29
Geth ¦ problem-solving: vrurg assigned to jnthn Issue Uncertain status of tests in the roast github.com/Raku/problem-solving/issues/217 23:16