🦋 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.
atweedie m: my @a = 1..4; for @a.kv -> $i, $j { "$i//$j".say } 12:50
camelia 0//1
1//2
2//3
3//4
atweedie m: my @a = 1..4; for ^Inf Z @a -> $i, $j { "$i//$j".say }
camelia 0 1//1 2
2 3//3 4
atweedie according to the (12-year old) perl6advent.wordpress.com/2009/12/...nd-profit/ the latter should be identical to the first? 12:51
frost m: my @a = 1..4; for (^Inf Z @a).flat -> $i, $j { "$i//$j".say } 12:54
camelia 0//1
1//2
2//3
3//4
frost my @a = 1..4; for ^Inf Z @a -> ($i, $j) { "$i//$j".say } 13:01
evalable6 0//1
1//2
2//3
3//4
atweedie ty! I realize I encountered .flat in the comments of one of the earlier sections. It was mentioned in the context of the Great List Refactor
ddg turns up some results on the GLR, so I'll do some reading...
frost the 2009 version is too old
atweedie oh that's nicer! 13:02
frost somethings must have be changed, but i don't know, too
the channel is so quiet today 13:03
Geth ecosystem: a4672f8e06 | (Elizabeth Mattijsen)++ | META.list
Remove Zodiac::Chinese

It appears to have vanished from existence
13:04
atweedie good to know that's an anomaly
frost will a new version be released this month? 13:10
lizmat .tell frost most likely not 13:26
tellable6 lizmat, I'll pass your message to frost
patrickb o/ 15:32
codesections: Did you notice: github.com/rakudo/rakudo/issues/46...-960553458 15:33
Guest4 Bonjour! Is it possible to use the zip operator with an inline function? Something like: 17:35
m: say <1 2 3> Z[&{$^a + $^b}] <4 4 4>
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in bracketed infix; couldn't find final ']' (corresponding starter was at line 1)
at <tmp>:1
------> 3say <1 2 3> Z[&7⏏5{$^a + $^b}] <4 4 4>
lizmat m: say <1 2 3> Z[&(* + *)] <4 4 4> # Guest4 17:42
camelia (5 6 7)
lizmat m: say <1 2 3> Z[&({ $^a + $^b })] <4 4 4> # Guest4 17:43
camelia (5 6 7)
Guest4 thank you lizmat! 17:47
MasterDuke github.com/rakudo/rakudo/issues/4423 is related 17:48
Guest4 and thank you for the caveat MasterDuke! 17:53
MasterDuke np
Guest4 okay, one more... why does this produce a Nil either side? 18:04
m: 'foo'.split("").map(*.ord)
camelia ( no output )
lizmat because that's what split dies 18:05
*does
MasterDuke m: 'foo'.split("", :skip-empty).map(*.ord).say
camelia (102 111 111)
lizmat you probably want .comb
MasterDuke m: 'foo'.comb.map(*.ord).say
camelia (102 111 111)
Guest4 Is the intent like C-strings to make a falsy delimiter for loop/construct termination on iteration over? 18:06
lizmat has trouble parsing your question
Guest4 Where can I look up why the sequence generated by split creates Nil on either end? 18:07
There is no mention of Nil at docs.raku.org/routine/split 18:08
MasterDuke "If DELIMITER is the empty string, it effectively returns all characters of the string separately (plus an empty string at the begin and at the end)."
Guest4 Thanks, but why?
[Coke] It's not a Nil, it's an empty string, IIRC. 18:09
m: dd 'this'.split('');
camelia ("", "t", "h", "i", "s", "").Seq
[Coke] :skip-empty is also mentioned in the first few paragraphs. 18:10
MasterDuke i don't actually know why that behavior was decided upon though
Guest4 Okay, thanks.
[Coke] Very old, and there's a note about it in the p5-raku page, IIRC 18:11
lizmat with "" you're splitting on the boundary between characters. The first character also have a boundary with the conceptual begin / end of string 18:12
*and last
but there's nothing inbetween 18:13
Guest4 Okay. That makes sense.
lizmat it can be handy on some situations :-)
Altreus Raku strikes me as the sort of language to have tokens that mean start of string and end of string
lizmat ^ and $
Altreus I mean values, identifiers
MasterDuke github.com/Raku/roast/commit/256d6...8d3b5696de is actually a bit more recent than i'd expected 18:14
lizmat PSA: the Rakudo Weekly News will be published tomorrow, 23 November 2021 19:20
p6steve hi all - can anyone tell me the docker / ubuntu recipe (ie. FROM xxx, RUN yyy) for a fast yet complete rakudo-star install? 19:27
(ok to point me to somewhere in GitHub that is a good jump off point)
El_Che p6steve: I just add the repo to a upstream distro image: github.com/nxadm/rakudo-pkg#os-repositories 19:30
(mind you: rakudo+zef, not rakudo-star)
p6steve El_Che yes ... perfect ... thanks !! 19:37
(other answers also of interest...) 19:38
El_Che p6steve: one of the use cases was containers because I throught star was not a match (you want small images) 19:39
p6steve: let me look for the docker image of jj
p6steve I have the jj images - no need
El_Che github.com/JJ/alpine-raku 19:40
p6steve they are cool for test ... but I want a (small) container image build setup
(actually raku + zen is better for what I need) 19:41
El_Che I am interested to hear if there are other options 19:44
SmokeMachine Do you people something like this (github.com/FCO/Test-Describe/blob/....rakutest) would make sense on the ecosystem? 20:49
lizmat it feels it lacks in the documentation dept :-) 20:56
lizmat goes afk&
gfldex m: say 'ⅯⅯⅩⅩⅠ'.Int; 21:51
camelia Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5ⅯⅯⅩⅩⅠ' (indicated by ⏏)
in block <unit> at <tmp> line 1
Nemokosch what the...
gfldex m: say 'Ⅳ'.Int; 21:52
camelia Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5Ⅳ' (indicated by ⏏)
in block <unit> at <tmp> line 1
Nemokosch I mean... should this even work? 😄
gfldex How else am I supposed to count those fine folk? i.pinimg.com/originals/9e/7c/8e/9e...c7c0f6.jpg 21:54
Nemokosch the hard 👏 way 👏
gfldex Given that years are still frequently¹ written in roman numerals, there is good reason to support that. 21:55
¹) by film studios to hide the fact of reruns 21:56
Nemokosch www.rosettacode.org/wiki/Roman_num...ecode#Raku
gfldex m: say Date.new(ⅯⅩⅩⅠ); 21:57
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in argument list; couldn't find final ')' (corresponding starter was at line 1)
at <tmp>:1
------> 3say Date.new(Ⅿ7⏏5ⅩⅩⅠ);
expecting any of:
tbrowder i think there is a module for roman numerals...maybe perl if not raku 22:28
Math::Roman 22:29
raku 22:30
gfldex That module doesn't talk unicode. 22:38
Nemokosch even better then, one can add a pull request 😛 22:52
tbrowder maybe time for a PR 23:45