🦋 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.
Xliff m: my @a = ^26; @a.skip(10).say 02:54
evalable6 (10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25)
Xliff m: my @a = ^26; @a.skip(10).reverse.skip(3).reverse.say 02:58
evalable6 (10 11 12 13 14 15 16 17 18 19 20 21 22)
Xliff ^^ Can that still lazy?
s/lazy/be lazy/?
AlexDaniel Xliff: good question 03:04
AlexDaniel not sure about @a, but with $a it can be done 03:04
by it can be done I mean maybe rakudo can be tweaked to do it 03:05
right now .skip works great but it returns a Seq 03:06
so suddenly all range-specific optimizations are gone
Xliff Ah, darn.
AlexDaniel which makes sense, but it's possible there's a way to do better 03:07
Xliff If you find a way I can trim an array from both ends without using a slice, that would be good. :)
Um... there is always [$start .. $end] though, innit?
AlexDaniel yes?
what's wrong with that? :)
Xliff m: my @a = ^26; @a[10 .. *-3].gist.say 03:08
evalable6 (10 11 12 13 14 15 16 17 18 19 20 21 22 23)
Xliff Nothing. I just thought of it.
Problem being now I need complex logic to handle start, end and startend combinations. :P
AlexDaniel though that's kinda not lazy enough still, not to my taste at least 03:09
Xliff Mine either. :P
AlexDaniel maybe we need something for Seq to limit the number of elements?
Xliff m: use NativeCall; use MONKEY-TYPING; class A is repr('CStruct') { has int32 $!a; }; augment A { method a { say $!a }; }; A.new(a => 42).a 03:10
evalable6 (exit code 1) 04===SORRY!04=== Er…
Xliff, Full output: gist.github.com/a18e6ccd8af3a60d13...7c3cf5c119
Xliff m: use NativeCall; use MONKEY-TYPING; class A is repr('CStruct') { has int32 $!a; }; augment class A { method a { say $!a }; }; A.new(a => 42).a
evalable6 0
Xliff m: use NativeCall; use MONKEY-TYPING; class A is repr('CStruct') { has int32 $!a; submethod BUILD (:$!a) { }; }; augment class A { method a { say $!a }; }; A.new(a => 42).a
evalable6 42
AlexDaniel Xliff: hey, what about .toggle ? 03:11
ZzZombo perlbot: rkeval: role R {has $!lastId = 'thing_A0';has $.id = {my $id = $!lastId; $!lastId .= succ; $id}() };say R.new, R.new
perlbot ZzZombo: R.new(id => "thing_A0")R.new(id => "thing_A0")␤
Xliff AlexDaniel: Hmm?
ZzZombo Is it possible to make the initializer run each time anew? 03:12
AlexDaniel m: say (1..99999999999999999999999).toggle(:off, * > 3, * < 6)
evalable6 (4 5)
AlexDaniel finally found a use for it :D
Xliff Ooo!
So that would work for .lines?
AlexDaniel sure
it should work with any Seq 03:13
Xliff Now to get that working with vars.
AlexDaniel Xliff: just put the vars in and then bang the keyboard until all off-by-one's are gone
… that's what I usually do…
:S 03:14
but hey, at least I'm honest about it :D
Xliff m: my $start = 0; my $end; my @conds = (* >= $start); @conds.push: * < $end if $end; say (1..14).toggle(:off, |@conds)
evalable6 (1 2 3 4 5 6 7 8 9 10 11 12 13 14)
Xliff m: my $start = 0; my $end=5; my @conds = (* >= $start); @conds.push: * < $end if $end; say (1..14).toggle(:off, |@conds) 03:15
evalable6 (1 2 3 4)
Xliff m: my $start = 0; my $end=5; my @conds = (* >= $start); @conds.push: * < @conds.elems - $end if $end; say (1..14).toggle(:off, |@conds)
evalable6 (1)
Xliff m: my $start = 0; my $end=5; my @conds = (* >= $start); @conds.push: * < (@conds.elems - $end) if $end; say (1..14).toggle(:off, |@conds)
evalable6 (1)
Xliff m: my $start = 0; my $end = 5; my @conds = (* >= $start); @conds.push: @cond.elems < $end if $end; say (1..14).toggle(:off, |@conds) 03:16
evalable6 (exit code 1) 04===SORRY!04=== Er…
Xliff, Full output: gist.github.com/a47885b5f03577272e...671647c4e1
Xliff m: my $start = 0; my $end = 5; my @conds = (* >= $start); @conds.push: * < $end if $end; say (1..14).toggle(:off, |@conds)
evalable6 (1 2 3 4)
Xliff m: my $start = 0; my $end = 5; my @conds = (* >= $start); @conds.push: * < $end if $end - @cond.elems; say (1..14).toggle(:off, |@conds)
evalable6 (exit code 1) 04===SORRY!04=== Er…
Xliff, Full output: gist.github.com/0478f0109fe999aafd...f054f3643b
Xliff Hum. That's not working as expected.
m: my @stuff = (1..14); my $start = 0; my $end = @stuff.elems - 5; my @conds = (* >= $start); @conds.push: * < $end if $end; say .toggle(:off, |@conds) 03:17
evalable6 (exit code 1) Cannot resolve caller toggle(Any:…
Xliff, Full output: gist.github.com/6d10cd5fa2fd2a581f...8439270059
Xliff m: my @stuff = (1..14); my $start = 0; my $end = +@stuff - 5; my @conds = (* >= $start); @conds.push: * < $end if $end; say @stuff.toggle(:off, |@conds) 03:18
evalable6 (1 2 3 4 5 6 7 8)
Xliff m: my @stuff = (1..14); my $start = 0; my $end = +@stuff - 4; my @conds = (* >= $start); @conds.push: * < $end if $end; say @stuff.toggle(:off, |@conds)
evalable6 (1 2 3 4 5 6 7 8 9)
Xliff AlexDaniel++
That works.
Yeeeesssss.
AlexDaniel lizmat++ for implementing toggle :) 03:18
Xliff Indeed.
AlexDaniel I guess it's one of those things that you may need once in a lifetime, but when that happens you *really* need it 03:20
Xliff Err... the usecase for this is a lot more common than that. 03:21
cat a file from line $a to $b 03:22
Try THAT in a shell. :P
ZzZombo rkeval: role R {has $!lastId = 'thing_A0';has $.id is default({my $id = $!lastId; $!lastId .= succ; $id}()) };say R.new, (my class C does R {}).new 03:23
perlbot ZzZombo: ===SORRY!===␤Cannot invoke this object (REPR: Null; VMNull)␤[Exited 1]
ZzZombo perlbot: rkeval: role R {has $!lastId = 'thing_A0';has $.id is default({my $id = $!lastId; $!lastId .= succ; $id}()) };say R.new, (my class C does R {}).new
perlbot ZzZombo: ===SORRY!===␤Cannot invoke this object (REPR: Null; VMNull)␤[Exited 1]
ZzZombo Hm?? 03:24
Xliff ZzZombo: You may want to look into AttrX::Mooish 03:40
ZzZombo: You can then lazily define the default attribute, then also include a trigger that will update the attribute every time it changes. Careful with that, however. 03:41
Xliff m: class A { has $!lastId = 'thing_A0'; method lastId is rw { Proxy.new: FETCH => -> $ { my $id = $!lastId; $!lastId .= succ; $id; }, STORE => -> $, $val { $!lastId = $val }; }; }; my $a = A.new; $a.lastId, $a.lastId 03:45
evalable6
Xliff m: class A { has $!lastId = 'thing_A0'; method lastId is rw { Proxy.new: FETCH => -> $ { my $id = $!lastId; $!lastId .= succ; $id; }, STORE => -> $, $val { $!lastId = $val }; }; }; my $a = A.new; $a.lastId.say, $a.lastId.say 03:46
evalable6 thing_A2
thing_A5
Xliff m: class A { has $!lastId = 'thing_A0'; method lastId is rw { Proxy.new: FETCH => -> $ { my $id = $!lastId; $!lastId .= succ; $id; }, STORE => -> $, $val { $!lastId = $val }; }; }; my $a = A.new; $a.lastId.say, $a.lastId.say
evalable6 thing_A2
thing_A5
Xliff m: class A { has $!lastId = 'thing_A0'; method lastId is rw { Proxy.new: FETCH => -> $ { say "F"; my $id = $!lastId; $!lastId .= succ; $id; }, STORE => -> $, $val { $!lastId = $val }; }; }; my $a = A.new; $a.lastId.say, $a.lastId.say 03:47
evalable6 F
F
F
thing_A2
F
F
F
thing_A5
Xliff Hrm. So many fetches! Why?
ZzZombo: ^^^
m: class A { has $!lastId = 'thing_A0'; method lastId is rw { Proxy.new: FETCH => -> $ { say "F"; my $id = $!lastId; $!lastId .= succ; $id; }, STORE => -> $, $val { $!lastId = $val }; }; }; my $a = A.new;
evalable6
Xliff m: class A { has $!lastId = 'thing_A0'; method lastId is rw { Proxy.new: FETCH => -> $ { say "F"; my $id = $!lastId; $!lastId .= succ; $id; }, STORE => -> $, $val { $!lastId = $val }; }; }; my $a = A.new; $a.lastId 03:48
evalable6 F
F
F
Xliff m: class A { has $!lastId = 'thing_A0'; method lastId is rw { Proxy.new: FETCH => -> $ { say "F"; my $id = $!lastId; $!lastId .= succ if $++ % 3 == 0 ; $id; }, STORE => -> $, $val { $!lastId = $val }; }; }; my $a = A.new; $a.lastId 03:49
evalable6 F
F
F
Xliff m: class A { has $!lastId = 'thing_A0'; method lastId is rw { Proxy.new: FETCH => -> $ { say "F"; my $id = $!lastId; $!lastId .= succ if $++ % 3 == 0 ; $id; }, STORE => -> $, $val { $!lastId = $val }; }; }; my $a = A.new; $a.lastId.say
evalable6 F
F
F
thing_A1
Xliff m: class A { has $!lastId = 'thing_A0'; method lastId is rw { Proxy.new: FETCH => -> $ { say "F"; my $id = $!lastId; $!lastId .= succ if $++ % 3 == 0 ; $id; }, STORE => -> $, $val { $!lastId = $val }; }; }; my $a = A.new; $a.lastId.say; $a.lastId.say
evalable6 F
F
F
thing_A1
F
F
F
thing_A2
Xliff Wow. Don't like that hack, though...
ZzZombo Van I turn off auto-closing starting brackets in Comma? It gets them every single time wrong. 04:35
Can*
rkeval: my Pair:D[Int:d] $a = :a<w>;say $a 05:07
perlbot ZzZombo: 5===SORRY!5=== Error while compiling /tmp/ZY53UHt5L9␤Invalid type smiley 'd' used in type name␤at /tmp/ZY53UHt5L9:1␤------> 3my Pair:D[Int:d7⏏5] $a = :a<w>;say $a␤ expecting any of:␤ pair value␤[Exited 1]
ZzZombo rkeval: my Pair:D[Int:D] $a = :a<w>;say $a
perlbot ZzZombo: a => w␤
ZzZombo rkeval: my Pair:D of Int:D $a = :a<w>;say $a
perlbot ZzZombo: 5===SORRY!5=== Error while compiling /tmp/DYZ6ZNUPP1␤Pair:D cannot be parameterized␤at /tmp/DYZ6ZNUPP1:1␤------> 3my Pair:D of Int:D7⏏5 $a = :a<w>;say $a␤[Exited 1]
ZzZombo LOL? 05:08
The more I try to use Raku, the less sense it starts to make to me.
rkeval: class IntPair is Pair does Associative[Int:D, Str:D];my IntPair $a = :a<w>;say $a 05:23
perlbot ZzZombo: 5===SORRY!5=== Error while compiling /tmp/TA9jaVuUPJ␤Semicolon form of 'class' without 'unit' is illegal. You probably want to use 'unit class'␤at /tmp/TA9jaVuUPJ:1␤------> 3 is Pair does Associative[Int:D, Str:D];7⏏5my IntPair $a = :a<w>;say $a␤[Exited 1]
ZzZombo rkeval: class IntPair is Pair does Associative[Int:D, Str:D] {};my IntPair $a = :a<w>;say $a
perlbot ZzZombo: Type check failed in assignment to $a; expected IntPair but got Pair (:a("w"))␤ in block <unit> at /tmp/6x4vhPzE5d line 1␤␤[Exited 1]
ZzZombo rkeval: class IntPair is Pair does Associative[Int:D, Str:D] {};my IntPair $a = :a<1>;say $a 05:24
perlbot ZzZombo: Type check failed in assignment to $a; expected IntPair but got Pair (:a(IntStr.new(1, "1")))␤ in block <unit> at /tmp/peiNKDOyJa line 1␤␤[Exited 1]
ZzZombo rkeval: class IntPair is Pair does Associative[Int:D, Str:D] {};my IntPair $a = :a(1);say $a
perlbot ZzZombo: Type check failed in assignment to $a; expected IntPair but got Pair (:a(1))␤ in block <unit> at /tmp/POtomGNhN1 line 1␤␤[Exited 1]
ZzZombo rkeval: class IntPair is Pair does Associative[Int:D, Str:D] {};my IntPair $a .= new(:a(1));say $a
perlbot ZzZombo: Cannot resolve caller new(IntPair:U: :a(Int)); none of these signatures match:␤ (Pair: Cool:D \key, Mu \value, *%_)␤ (Pair: Mu \key, Mu \value, *%_)␤ (Pair: Mu :$key!, Mu :$value!, *%_)␤ in block <unit> at /tmp/2ckiLaPZuE line 1␤␤[Exited 1]
ZzZombo rkeval: class IntPair is Pair does Associative[Int:D, Str:D] {};my IntPair $a .= new('a', 1);say $a 05:25
perlbot ZzZombo: a => 1␤
ZzZombo rkeval: class IntPair is Pair does Associative[Int:D, Str:D] {};my IntPair $a .= new('a', 5);say $a
perlbot ZzZombo: a => 5␤
ZzZombo rkeval: class IntPair is Pair does Associative[Int:D, Str:D] {};my IntPair $a .= new('a', '3');say $a
perlbot ZzZombo: a => 3␤
ZzZombo rkeval: class IntPair is Pair does Associative[Int:D, Str:D] {};my IntPair $a .= new('a', 'asd');say $a
perlbot ZzZombo: a => asd␤
ZzZombo Damn.
And another one: can't construct a `Pair` out of another `Pair`... 05:26
rkeval: class IntPair is Pair does Associative[Int:D, Str:D] {};my IntPair $a .= new('a', 'asd');say $a.of, $a.keyof
perlbot ZzZombo: (Int:D)(Str:D)␤
ZzZombo rkeval: class IntPair is Pair does Associative[Int:D, Str:D] {};my IntPair $a .= new; $a<a>='asd';say $a 05:27
perlbot ZzZombo: Cannot resolve caller new(IntPair:U: ); none of these signatures match:␤ (Pair: Cool:D \key, Mu \value, *%_)␤ (Pair: Mu \key, Mu \value, *%_)␤ (Pair: Mu :$key!, Mu :$value!, *%_)␤ in block <unit> at /tmp/FcfzVHwWua line 1␤␤[Exited 1]
ZzZombo rkeval: class IntPair is Pair does Associative[Int:D, Str:D] {};my IntPair $a .= new: a=>0; $a<a>='asd';say $a 05:28
perlbot ZzZombo: Cannot resolve caller new(IntPair:U: :a(Int)); none of these signatures match:␤ (Pair: Cool:D \key, Mu \value, *%_)␤ (Pair: Mu \key, Mu \value, *%_)␤ (Pair: Mu :$key!, Mu :$value!, *%_)␤ in block <unit> at /tmp/X6wKd_y_Mr line 1␤␤[Exited 1]
ZzZombo rkeval: class IntPair is Pair does Associative[Int:D, Str:D] {};my IntPair $a .= new: 'a', 0; $a<a>='asd';say $a
perlbot ZzZombo: Cannot modify an immutable Int (0)␤ in block <unit> at /tmp/g5RJpk7id2 line 1␤␤[Exited 1]
jmerelo .seen Kaiepi 06:36
tellable6 jmerelo, I saw Kaiepi 2019-12-08T10:52:18Z in #raku-dev: <Kaiepi> ah there you are
jmerelo .tell Kaiepi how's your Advent Calendar article going? 06:37
tellable6 jmerelo, I'll pass your message to Kaiepi
abc_not_cba hi. why ? 08:58
tadzik becuase it's the correct order in the alphabet 08:59
moritz Kafka says hi :D 09:27
SmokeMachine Should setting LC_ALL to tr_TR be enough to make `”i”.uc` be “İ”? 11:05
SmokeMachine en.wikipedia.org/wiki/Dotted_and_dotless_I 11:07
Geth doc: c9222dfdaa | (Elizabeth Mattijsen)++ | doc/Type/Range.pod6
Update Range.int-bounds doc

Reflects the tightened implementation.
11:41
tbrowder .tell ab6tract i have a usable version of CheckFile that suits most of my use cases, but it may not suit other users 12:09
tellable6 tbrowder, I'll pass your message to ab6tract
chloekek p6: say 「🏴󠁧󠁢󠁳󠁣󠁴󠁿」.chars 12:46
evalable6 1
chloekek Hmm, D’s grapheme decoder reports 7 graphemes for this instead of 1. 12:47
I’ll check what ICU does. 12:49
Doc_Holliwood The impossible happened. 13:33
Someone mad Raku available for Android 13:34
*made
See apkpure.com/raku-radio-news-podcas...et.amp.dvr 13:35
chloekek Doc_Holliwood: seems unrelated to the Raku programming language. 13:36
It seems to be a different project that by coincidence has the same name.
thundergnat m: say 「🏴󠁧󠁢󠁳󠁣󠁴󠁿」.codes 13:39
evalable6 7
thundergnat m: say 「🏴󠁧󠁢󠁳󠁣󠁴󠁿」.encode(<utf8>).bytes
evalable6 28
Doc_Holliwood I know. I was trying to be funny. 13:40
chloekek p6: say 「🚒」.chars 13:48
evalable6 1
chloekek p6: my $x-y = 1; my $z = 2; say $x-y−z; 14:43
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/uBzYMdqXAS
Undeclared routine:
z used at line 1
chloekek p6: my \x-y = 1; my \z = 2; say x-y−z;
evalable6 -1
chloekek Beautiful.
chloekek p6: my \x—y = 1; say x—y; 14:58
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/9QDkUQtCys
Term definition requires an initializer
at /tmp/9QDkUQtCys:1
------> 03my \x08⏏04—y = 1; say x—y;
chloekek No em-dashes in identifiers. :(
Kaiepi . 15:24
tellable6 2019-12-11T06:37:24Z #raku <jmerelo> Kaiepi how's your Advent Calendar article going?
Kaiepi .tell jmerelo, i have a draft finished, but the example code i use might need some tweaking. depends on what you think. lemme know when you get on 15:25
tellable6 Kaiepi, I'll pass your message to jmerelo
chloekek p6: constant term:<⦜> = 90 × π / 180; say sin(⦜); 16:22
evalable6 1
jmerelo The [raku] tag is up to 600 questions now in StackOverflow. But still need to swap [perl6] for [raku] in another 300 or so to be able to create a synonym 17:38
tellable6 2019-12-11T02:46:07Z #raku-dev <tbrowder> jmerelo tyil suggests ecosystem improvements as possible GSoC project
2019-12-11T15:25:29Z #raku <Kaiepi> jmerelo, i have a draft finished, but the example code i use might need some tweaking. depends on what you think. lemme know when you get on
jmerelo stackoverflow.com/questions/tagged/raku So please go back to your old questions, or to any question if you've got the privs, and delete the perl6 tags, substituting for raku 17:39
.tell Kaiepi I'm around, or you can contact me via Telegram or email, double the initial j, and add gmail.com 17:40
tellable6 jmerelo, I'll pass your message to Kaiepi
jmerelo .tell tbrowder tyil a pretty neat idea. Please do a PR on the new site 17:41
tellable6 jmerelo, I'll pass your message to tbrowder
Geth doc: 1594b19770 | (Stoned Elipot)++ | doc/Language/control.pod6
Standardizes example output
20:12
josef_october j #k4cg 21:26
chloekek p6: sub f(@xs) { @xs.push(4); }; my @xs = 1, 2, 3; f(@xs); say @xs 22:37
evalable6 [1 2 3 4]
tbrowder jmdrelo: which site for the PR? 23:55
tellable6 2019-12-11T17:41:17Z #raku <jmerelo> tbrowder tyil a pretty neat idea. Please do a PR on the new site
tbrowder hi, question ref topic variable: in a for loop "for f.IO.lines {..." 23:57
am i free to define 23:58
*ref$_
*redefine value of $_ during the 23:59
*at the top of the loop and still use when later in the loop?