»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋
Set by Zoffix on 25 July 2018.
00:00 Sgeo left
samcv no problem 00:02
00:09 nadim_ left 00:12 pamplemousse joined 00:19 vike joined 00:23 eseyman joined 00:25 sena_kun left 00:29 kensanata left 00:40 netrino left 00:55 aborazmeh left 01:02 pamplemousse left, pamplemousse joined 01:16 MasterDuke left 01:29 squashable6 left, squashable6 joined, MilkmanDan left 01:31 MilkmanDan joined 01:36 pamplemousse left 01:44 lucasb left 02:40 aborazmeh joined, aborazmeh left, aborazmeh joined 03:10 Sgeo__ joined 03:13 Sgeo_ left 03:26 quester joined 03:31 aborazmeh left 03:34 AlexDani` joined 03:38 araraloren joined 04:05 khisanth_ left 04:08 squashable6 left 04:10 squashable6 joined, ChanServ sets mode: +v squashable6 04:15 rindolf joined 04:24 khisanth_ joined 04:41 jeromelanteri joined 04:54 araraloren left 05:30 AlexDani` is now known as AlexDaniel, AlexDaniel left, AlexDaniel joined 06:22 jeromelanteri left
Geth doc/master: 6 commits pushed by threadless-screw++, (Juan Julián Merelo Guervós)++ 06:54
06:54 domidumont joined 07:19 domidumont left
Geth doc: b28632f769 | (JJ Merelo)++ | 2 files
Adds headings to the return type arrow, closes #2921
07:26
doc: b0d5cf9da8 | (JJ Merelo)++ | doc/Type/Signature.pod6
Deindent for #2921
synopsebot Link: doc.perl6.org/type/Signature
07:37 quester left 07:45 Black_Ribbon left 07:56 chloekek joined 08:00 antoniogamiz joined
antoniogamiz o/ 08:00
08:08 antoniogamiz left
AlexDaniel any MacOS users here? Can you try following these steps? github.com/rakudo/rakudo/issues/30...-515742084 08:13
and then `use NativeCall` using the installed binary 08:15
08:24 antoniogamiz joined
chloekek When I run with --profile and I get "Could not locate profiler/template.html" did I configure MoarVM wrong? 08:32
I see what is wrong. It tries to look for share/nqp/lib/profiler/template.html under the MoarVM prefix but the file is under the NQP prefix. 08:42
08:51 rindolf left
lizmat chloekek: please, make an issue :-) 08:58
chloekek Yeah I did :) github.com/perl6/nqp/issues/567
lizmat chloekek++
09:19 rindolf joined 09:43 dudz joined 10:09 nepugia joined 10:23 rindolf left 10:29 aborazmeh joined, aborazmeh left, aborazmeh joined 10:32 leah2 left
Geth doc: threadless-screw++ created pull request #2923:
Minor corrections to regexes section; also fixes #2873
10:41
10:48 leah2 joined, aborazmeh left 11:46 sena_kun joined 12:05 nadim_ joined
antoniogamiz sena_kun: what do you think about this? => github.com/croservices/cro-http/issues/80 12:08
12:09 antoniogamiz left
sena_kun let's see... 12:10
hmm, curl understands it, I think so should we 12:13
12:27 rindolf joined
sena_kun hmm, this is a bit involved... 12:36
ah, it is not 12:40
ugexe maybe because \_ isn’t a valid escape sequence 12:50
sena_kun yeah
writing an answer now...
12:55 draxil joined
draxil Hi. Is there a perl6y way to do "which $MYCOMMAND"? Basically I want to test for the presence of a command in a test, and bail out if it's not present. 12:57
sena_kun github.com/azawawi/perl6-file-which ? 12:58
you can, of course, write it by hands 13:00
draxil Thanks.Good to know that exists. I probably don't want to add a dependency here. In hindsight I should probably just try and run the command and bail out. 13:01
sena_kun give me a second...
draxil ..if it fails. Perhaps I should look at the error you get for not being able to find the thing
nepugia draxil: if you want to run the command run "command -v" not which
sena_kun I am now writing a two-liner...
draxil thanks. 13:02
sena_kun m: my @paths = %*ENV<PATH>.split(':'); for @paths -> $path { if $path.IO.child('cat').e { say "cat is found at $path" } }
camelia cat is found at /usr/bin
cat is found at /bin
sena_kun this is GNU/Linux only, so apparently won't work on Windows and probably OSX 13:03
alternatively, of course, you can just try to run it and see the output
draxil thanks .
nepugia command -v is POSIX anyhow, that should def work on osx
ugexe The not nice thing about trying commands that might not exist is that enough of those tries will deadlock you 13:05
draxil that's just leave windows, which would probably require other modifications anyway. Is there much perl6 in windows? Anyway. You've been helpful cheers.
ugexe Yes people are using perl6 on windows 13:06
ugexe wonders if one dependency is really that bad 13:07
nepugia You start with one dep, and soon you have two :) 13:08
timotimo i think we have a variable that gives you the separator of $PATH
ugexe So you grow an entire project with 0 dependencies out of fear of a second dependency?
nepugia but of course ;) 13:09
draxil probably not, I haven't gotten to the packaging side yet.. I'm probably overthinking every step as this but I haven't released anything into the wild for Perl6 yet so I don;t have confirmed biases and habits yet :)
ugexe Something that requires a bunch of crap to work cross platform is a good candidate for a dependency, unlike e.g. leftpad 13:11
timotimo i mean, it's easy to get leftpad wrong 13:13
ugexe Chances are they are already doing a bunch of shit wrong because they are programmers. So who cares 13:14
timotimo yeah, maybe
at least in perl6 you're not accidentally cutting characters in half 13:15
sena_kun does that in repl all the time
ugexe Leftpad, but multithreaded 13:16
timotimo multipadding 13:17
chloekek One thread for each transitive dependency, be careful not to reach threads-max!
timotimo if your node_modules doesn't fit into l3 cache, i've got bad news for you 13:19
13:19 Sgeo__ left, Sgeo__ joined 13:21 mowcat joined 13:22 mowcat left, mowcat joined 13:23 Cabanossi left
nepugia Cpu vendors will add l4? :) 13:25
13:27 Cabanossi joined
chloekek ARM already has an instruction to aid float to integer conversion specifically for JS bitwise operations 13:27
The name of the instruction even mentions JS 13:28
13:32 Black_Ribbon joined 13:36 draxil left 14:06 lucasb joined 14:46 pamplemousse joined 14:59 tokomer joined, Actualeyes joined 15:01 pamplemousse left 15:08 pamplemousse joined 15:45 Sgeo__ left 15:46 pamplemousse left, ayerhart joined 15:53 dotdotdot joined
chloekek p6: sub f($x is rw, $y is rw) { $x = 2; say $y; }; my $x = 1; f($x, $x); 16:47
camelia 2
16:50 pamplemousse joined 16:54 Sgeo joined 16:55 leah2 left 16:57 Manifest0 joined 17:03 pecastro joined 17:09 leah2 joined 17:14 pamplemousse left, pamplemousse joined 17:19 pamplemousse left 17:20 pamplemousse joined 17:23 jmerelo joined 17:30 domidumont joined 17:47 pamplemousse left 18:06 patrickb joined 18:13 cpan-p6 left 18:14 cpan-p6 joined, cpan-p6 left, cpan-p6 joined 18:24 leah2 left 18:26 lucasb left 18:39 leah2 joined 18:46 pamplemousse joined 18:50 netrino joined 19:00 leah2 left 19:01 domidumont left 19:02 jmerelo left 19:09 pamplemousse left, pamplemousse joined 19:14 leah2 joined
Xliff Can someone tell me why Perl6 throws an error when two signatures match, but they are at a different level of the MRO? 19:18
If I have a class C, that is a descendant of class A, why isn't class C's method chosen over class A's? 19:19
Both methods have a matching signature.
timotimo is it the type constraint on the invocant that's doing it? 19:20
Xliff yep.
class A { multi x method x (IntOrStr $xv) { say "A: $xv"; }; }; class C is A { my subset IntOrStr where Int | Str; multi method x (IntOrStr $xv) { say "C: $xv" }; }; C.new.xv('Hi') 19:22
m: class A { multi x method x (IntOrStr $xv) { say "A: $xv"; }; }; class C is A { my subset IntOrStr where Int | Str; multi method x (IntOrStr $xv) { say "C: $xv" }; }; C.new.xv('Hi')
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3class A { multi x7⏏5 method x (IntOrStr $xv) { say "A: $xv";
expecting any of:
new name to be defined
19:22 pamplemousse left
Xliff m: class A { multi method x (IntOrStr $xv) { say "A: $xv"; }; }; class C is A { my subset IntOrStr where Int | Str; multi method x (IntOrStr $xv) { say "C: $xv" }; }; C.new.xv('Hi') 19:22
camelia 5===SORRY!5=== Error while compiling <tmp>
Invalid typename 'IntOrStr' in parameter declaration. Did you mean 'IntStr'?
at <tmp>:1
------> 3class A { multi method x (IntOrStr7⏏5 $xv) { say "A: $xv"; }; }; class C is A
Xliff m: my subset IntOrStr where Int | Str; class A { multi method x (IntOrStr $xv) { say "A: $xv"; }; }; class C is A { multi method x (IntOrStr $xv) { say "C: $xv" }; }; C.new.xv('Hi') 19:23
camelia No such method 'xv' for invocant of type 'C'. Did you mean any of these?
kv
x

in block <unit> at <tmp> line 1
Xliff m: my subset IntOrStr where Int | Str; class A { multi method x (IntOrStr $xv) { say "A: $xv"; }; }; class C is A { multi method xv (IntOrStr $xv) { say "C: $xv" }; }; C.new.xv('Hi')
camelia C: Hi
Xliff ^^ THAT is what I am expecting!
19:24 pamplemousse joined
Xliff gist.github.com/Xliff/2123bdc09b0f...1d748e0700 19:28
timotimo hm, the Mu is less specific, but the where { ... } makes it more specific, maybe they end up at the same "level"? 19:29
could try an "is default"
Xliff Oh!
I didn't know that existed! 19:30
\o/ 19:31
timotimo++
m: class C is B { multi method a is default {}; }; class B is A { multi method a is default {}; }; class A { multi method a {}; }; C.new.a 19:35
camelia 5===SORRY!5=== Error while compiling <tmp>
'C' cannot inherit from 'B' because it is unknown.
at <tmp>:1
19:35 kawaii joined
Xliff m: class A { multi method a {}; }; class B is A { multi method a is default {}; }; class C is B { multi method a is default {}; }; C.new.a 19:36
camelia ( no output )
Xliff m: class A { multi method a {}; }; class B is A { multi method a is default {}; }; class C is B { multi method a is default { 'C'.say }; }; C.new.a
camelia C
Xliff \o/ \o/
m: class A { multi method a {}; }; class B is A { multi method a is default {}; }; class C is B { multi method a is default { 'C'.say }; }; B.new.a
camelia ( no output )
Xliff m: class A { multi method a {}; }; class B is A { multi method a is default { 'B'.say }; }; class C is B { multi method a is default { 'C'.say }; }; B.new.a
camelia B
19:39 pamplemousse left
cpan-p6 New module released to CPAN! Async::Workers (0.0.7) by 03VRURG 19:46
19:47 pamplemousse joined 19:53 someuser joined 19:56 nepugia is now known as nephele 20:05 tokomer left 20:24 _jrjsmrtn joined, patrickb left 20:26 jlinahan joined, someuser left, __jrjsmrtn__ left 20:29 MasterDuke joined 20:38 MasterDuke left 20:39 jlinahan left 20:41 MasterDuke joined 20:49 irced joined
cpan-p6 New module released to CPAN! Gnome::Gtk3 (0.17.7) by 03MARTIMM 20:51
20:53 _jrjsmrtn left
irced I getting a failed test on ===> Testing: Gnome::GObject:ver<0.13.13> when zef'ing Gnome::Gtk3. any1 know if this is an issue? 20:58
21:02 Sgeo_ joined 21:05 Sgeo left 21:25 rindolf left
sena_kun irced, can you provide a bit more of your log? I am sure there should be some reasons for tests to fail, but nobody can guess them with only a fact that tests are failing for someone somewhere? 21:25
irced sena_kun: cpan-p6 announced the new module. perhaps you can try yourself? 21:26
sena_kun irced, I tried, I don't have libgtk-3 installed.
irced sena_kun: i do have libgtk-3 installed. did you get the same error tho?
sena_kun irced, I don't know what error you are getting, so I can't tell if they are the same. 21:27
irced sena_kun: well, without getting too specific, the the test failed on ===> Testing: 21:28
Gnome::GObject:ver<0.13.13> when zef'ing Gnome::Gtk3
lizmat weekly: perl6.eu/substring-queues.html 21:33
notable6 lizmat, Noted!
irced so let me start with a more general question, has anyone successfully zef'd Gnome::Gtk3 (0.17.7) ? 21:35
21:36 Sgeo__ joined 21:37 reach_satori_ joined 21:39 Sgeo_ left 21:40 reach_satori left
ugexe 0.17.7 isnt on cpan. the source-url on the github/ecosystem version is wrong. surprised you are getting to test phase 21:45
21:47 nephele left
irced ugexe: thanks for looking into it! 21:47
Elronnd irced: I just got the same error as you 21:48
ugexe oh i see it was *just* released to cpan. it must not be in the index yet
Elronnd "Could not find Gnome::Gdk3::Events at line 40 in"
irced Elronnd: thanks for confirming it's not an isolated issue (at least not completely) 21:49
lizmat weekly: p6steve.wordpress.com/2019/07/28/mind-the-gap/ 21:50
notable6 lizmat, Noted!
irced maybe it's just a 0.17.6 thing and 0.17.7 will be available shortly 21:55
irced found the tarbell for 0.17.7. same deal 21:58
has anyone successfully installed a recent version of Gnome::Gtk3 ?
Elronnd: what linux distribution are you using?
Elronnd arch
irced gentoo here. do you have gtk3 development files installed? 21:59
Elronnd (also, how do you know I'm running linux?)
you don't need development files
irced Elronnd: have you installed this module before?
Elronnd what are called 'dev files' are for developing with c. These *are* dev files for p6
irced Elronnd: just libraries
Elronnd I don't think I have
irced Elronnd: just libraries i see 22:00
Elronnd on arch they're not separate
irced Elronnd: or that :-)
Elronnd :)
irced Elronnd: I just assume everyone runs linux and is as scared of microsoft as i am. 22:04
Elronnd: and other big tech.
Elronnd ms is not very scary. Nor apple. I can't stand windows nor macos but they're fine 22:05
Scary is google and facebook and tencent
irced Elronnd: oh, ok, well, that's good, you're well adjusted 😄at least more than I am 22:06
Elronnd lol
the main thing is just, ms can survive without windows. They can sell support contracts for exactly the same price. Google can't survive without taking away everyone's freedom 22:07
irced Elronnd: I see, some are relatively scarier. Nice observation. 22:08
Elronnd: how long you been coding in perl6? 22:09
Elronnd well
I started learning it seriously a good few months ago 22:10
but I dropped off. Been focusing on other things
you?
irced Elronnd: I started and dropped off a few months ago and am now getting into the details. 22:12
Elronnd: these types are a mental trip. like Range List Seq Array and their relations feel like astronomical science with relativity in the mix. 22:16
Elronnd: in other words, positionals. did i miss one? 22:18
Elronnd no idea
I never got that deep into all the types
irced 😄
Elronnd: well, you will 😄 22:19
Elronnd if I get the time! 22:20
I have too many projects in other languages
irced Elronnd: right, time. time is the key to learning a programming language. what other languages? 22:21
Elronnd main one right now is d
irced Elronnd: whoa, you like to stay on the fringe.
Elronnd heh
also gonna write a WM for arcan 22:22
also want to fix the web, which probably involves a lot of c++ and python
22:23 Cabanossi left
irced Elronnd: what's arcan ? yeah, the web feels like a spider web what with privacy concerns abound. 22:23
sena_kun Array is, well, an array of things you can address by index, List is an immutable array, range is a range of usually numbers of strings, think "from 1 to 10", "from a to z", "from pi to infinity" and so on, Seq is something that produces values lazily. 22:24
Elronnd arcan is a display server, competitor to x11 and wayland except unlike both of them it's actually sanely designed
I actually don't want to fix the privacy issues. I mean, I'd like them to be solved but I don't think that can be done
I mainly want to solve the developing-for-web-is-a-clusterfuck and using-web-is-a-clusterfuck problems
irced Elronnd: yeah, i hope to use perl6 to help me develop more fluidly in other languages, which it seems to be in part made for, supposedly trumping all lex'ers with its versatility.... 22:26
sena_kun: good summary
Elronnd hmm. I didn't take anything from it to other languages. But yeah that was what I took from it; it's so fluid I can do whatever I want 22:27
irced m: my $seq = (1 ... 10); for $seq { say $_ }
camelia (1 2 3 4 5 6 7 8 9 10)
irced m: my $seq = ( 1 ... 10); for @$seq { say $_ }
camelia 1
2
3
4
5
6
7
8
9
10
irced m: my $seq = (1 ... 10); for $seq.eager { say $_ } 22:28
camelia 1
2
3
4
5
6
7
8
9
10
irced i once was blind and now i can see!
Elronnd m: .say for (1 ... 10)
irced thanks sena_kun. i made the sequence non-lazy and it behaved like a list
camelia 1
2
3
4
5
6
7
8
9
10
Elronnd m: .say for (1 ... 10).eager 22:29
camelia 1
2
3
4
5
6
7
8
9
10
Elronnd hmm
irced for seems to take ( ... ) as a list when you define the sequence in the for statement 22:30
that it, it assumes it will not be lazy
as after all, every value will be iterated upon
now i can see even better
thanks Elronnd
Elronnd I don't see! 22:31
irced yeah, well, there is a missing piece
since
m: my $seq = ( 1.. 10 ); for $seq { say "$++: $_" } 22:32
camelia 5===SORRY!5=== Error while compiling <tmp>
Non-variable $ must be backslashed
at <tmp>:1
------> 3my $seq = ( 1.. 10 ); for $seq { say "7⏏5$++: $_" }
expecting any of:
argument list
double quotes
pre…
irced oops
ugexe what do you expect it to do?
irced m: my $seq = ( 1.. 10 ); for $seq { say "$++: $_"; }
camelia 5===SORRY!5=== Error while compiling <tmp>
Non-variable $ must be backslashed
at <tmp>:1
------> 3my $seq = ( 1.. 10 ); for $seq { say "7⏏5$++: $_"; }
expecting any of:
argument list
double quotes
pr…
irced to not fail
😄
ugexe {$++} 22:33
but besides that
irced m: my $seq = ( 1 .. 10 ); for $seq { say "{$++}: $_"; }
camelia 0: 1 2 3 4 5 6 7 8 9 10
ugexe you are acting like lazyness is the cause of some issue
irced duh, thanks ugexe
i thought it was
since
m: my $seq = ( 1 .. 10 ); for $seq.eager { say "{$++}: $_"; }
camelia 0: 1
0: 2
0: 3
0: 4
0: 5
0: 6
0: 7
0: 8
0: 9
0: 10
22:34 pecastro left
irced m: my $seq = ( 1 .. 10 ); my $counter=0; for $seq.eager { say "{counter++}: $_"; } 22:34
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
counter used at line 1
irced m: my $seq = ( 1 .. 10 ); my $counter=0; for $seq.eager { say "{$counter++}: $_"; }
camelia 0: 1
1: 2
2: 3
3: 4
4: 5
5: 6
6: 7
7: 8
8: 9
9: 10
ugexe i guess you beed $++ ~ ": $_"
irced m: my $seq = ( 20 .. 30 ); my $counter=0; for $seq.eager { say "{$counter++}: $_"; }
camelia 0: 20
1: 21
2: 22
3: 23
4: 24
5: 25
6: 26
7: 27
8: 28
9: 29
10: 30
22:35 chloekek left
ugexe $seq.list 22:35
irced right, which makes it non-lazy
m: my $seq = ( 20 .. 30 ); my $counter=0; for $seq.List { say "{$counter++}: $_"; }
camelia 0: 20
1: 21
2: 22
3: 23
4: 24
5: 25
6: 26
7: 27
8: 28
9: 29
10: 30
irced m: my $seq = ( 20 .. 30 ); my $counter=0; for $seq { say "{$counter++}: $_"; }
camelia 0: 20 21 22 23 24 25 26 27 28 29 30
ugexe what do you mean?
irced for operates on a lazy type differently than on a non-lazy type 22:36
tobs it's not laziness, it's itemization
irced m: my $seq = ( 20 .. 30 ); my $counter=0; for @$seq { say "{$counter++}: $_"; }
camelia 0: 20
1: 21
2: 22
3: 23
4: 24
5: 25
6: 26
7: 27
8: 28
9: 29
10: 30
tobs m: my $seq = ( 20 .. 30 ); my $counter=0; for $seq.self { say "{$counter++}: $_"; }
camelia 0: 20
1: 21
2: 22
3: 23
4: 24
5: 25
6: 26
7: 27
8: 28
9: 29
10: 30
22:36 Cabanossi joined
irced tobs: self, cool, haven't seen that one 22:36
tobs: itemization of a sequence, that's new to me, thanks 22:37
ugexe .cache, .Array, etc
tobs $seq is inside a scalar container, so for sees only a single element. If you call a method like .eager or even .self (which doesn't remove the laziness), you get rid of the container.
irced m: my $seq = ( 20 .. 30 ); my $counter=0; for |$seq { say "{$counter++}: $_"; }
camelia 0: 20
1: 21
2: 22
3: 23
4: 24
5: 25
6: 26
7: 27
8: 28
9: 29
10: 30
irced a hah!
a ha!
m: my $seq = ( 20 .. 30 ); my $counter=0; for $seq.slip { say "{$counter++}: $_"; }
tobs or use binding
camelia No such method 'slip' for invocant of type 'Range'. Did you mean any of these?
Slip
flip
sin
skip

in block <unit> at <tmp> line 1
irced m: my $seq = ( 20 .. 30 ); my $counter=0; for $seq.Slip { say "{$counter++}: $_"; }
camelia 0: 20
1: 21
2: 22
3: 23
4: 24
5: 25
6: 26
7: 27
8: 28
9: 29
10: 30
tobs m: my $seq := ( 20 .. 30 ); my $counter=0; for $seq { say "{$counter++}: $_"; }
camelia 0: 20
1: 21
2: 22
3: 23
4: 24
5: 25
6: 26
7: 27
8: 28
9: 29
10: 30
irced tobs: excellent! 22:38
itemization of a sequence is key for "for" to iterate over each member of the sequence
irced now can see.
irced no really.
😄 22:39
tobs: the binding part is going to take awhile for me to get completely i think
my $seq := ( 20 .. 30 ); say $seq.^name; say $seq.perl;
evalable6 Range
20..30
irced m: my $seq := ( 20 .. 30 ); say $seq.^name; say $seq.perl; 22:40
camelia Range
20..30
irced m: my $seq := ( 20 ... 30 ); say $seq.^name; say $seq.perl;
camelia Seq
(20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30).Seq
irced oops i might have been making ranges with two dots for awhile there
ugexe you do make ranges with 2 dots 22:41
irced yeah, i started with sequences
tobs irced: I found this helpful (and it became more ever more helpful after I read it the 10th time): perl6advent.wordpress.com/2017/12/...ontainers/
irced but anyway, either need to be itemized for "for"
tobs: thanks
m: my $seq = ( 10 ... 0 ); my $counter=0; for $seq { say "{$counter++}: $_"; } 22:42
camelia 0: 10 9 8 7 6 5 4 3 2 1 0
irced m: my $seq = ( 10 ... 0 ); my $counter=0; for |$seq { say "{$counter++}: $_"; }
camelia 0: 10
1: 9
2: 8
3: 7
4: 6
5: 5
6: 4
7: 3
8: 2
9: 1
10: 0
ugexe those ranges should be using ..
irced m: my $seq := ( 10 ... 0 ); my $counter=0; for $seq { say "{$counter++}: $_"; }
camelia 0: 10
1: 9
2: 8
3: 7
4: 6
5: 5
6: 4
7: 3
8: 2
9: 1
10: 0
irced m: my $seq := ( 10 ... 0 ); say $seq.^name; 22:43
camelia Seq
ugexe m: say 5, 10 ... 20;
camelia (5 10 15 20)
ugexe note the difference
irced i guess binding itemizes it
m: my $seq := ( 10, 8 ... 0 ); say $seq.^name;
camelia Seq
irced m: my $seq := ( 10, 8 ... 0 ); say $seq;
camelia (10 8 6 4 2 0)
irced m: my $seq := ( 10, 8 ... 0 ); say |$seq;
camelia 1086420
ugexe you understand .. is not the same as ... now? 22:44
irced m: my $seq := ( 10, 8 ... 0 ); say $seq.eager;
camelia (10 8 6 4 2 0)
irced oh yes, i know, but it's the for loop operating on ranges and sequences requiring itemization that i was not really seeing until now
the for loop treats the sequence/range as a single entity unless itemized or slipped 22:45
ugexe no its treating the sequence as a *single item* 22:46
irced m: my $seqs = ( (5 ... 0), (20 ... 25) ); for $seqs { for |$_ { say $_ } }
camelia (5 4 3 2 1 0)
(20 21 22 23 24 25)
ugexe its not about the sequence needing to itemize its contents
irced m: my $seqs = ( (5 ... 0), (20 ... 25) ); for $seqs { for $_.List { say $_ } }
camelia (5 4 3 2 1 0)
(20 21 22 23 24 25)
irced m: my $seqs = (5 ... 0), (20 ... 25) ; for $seqs { for $_.List { say $_ } } 22:47
camelia 5
4
3
2
1
0
irced m: my $seqs = ((5 ... 0), (20 ... 25)) ; for |$seqs { for $_ { say $_ } }
camelia 5
4
3
2
1
0
20
21
22
23
24
25
irced m: my $seqs = ((5 ... 0), (20 ... 25)) ; for |$seqs { for $_ { say $_ }; say "next" }
camelia 5
4
3
2
1
0
next
20
21
22
23
24
25
next
irced m: my $seqs = ((5 ... 0), (20 ... 25)) ; for |$seqs { for $_ { say $_ }; NEXT {say "next";} }
camelia 5
4
3
2
1
0
next
20
21
22
23
24
25
next
ugexe for flat ... 22:48
irced m: my $seqs = ((5 ... 0), (20 ... 25)) ; for |$seqs { for $_ { say $_; say "next";} } 22:51
camelia 5
next
4
next
3
next
2
next
1
next
0
next
20
next
21
next
22
next
23
next
24
next
25
next
irced anyway, thanks for the discussioin 23:01
23:02 nadim_ left 23:03 MasterDuke left
irced m: my $seqs = ((5 ... 0), (20 ... 25)) ; for |$seqs { for $_ { say $_;} unless ++$ == $seqs.elems { say " next "; } } 23:08
camelia 5===SORRY!5=== Error while compiling <tmp>
Strange text after block (missing semicolon or comma?)
at <tmp>:1
------> 3. 25)) ; for |$seqs { for $_ { say $_;}7⏏5 unless ++$ == $seqs.elems { say " next
23:09
irced m: my $seqs = ((5 ... 0), (20 ... 25)) ; for |$seqs { for $_ { say $_}; unless ++$ == $seqs.elems { say " next "; } } 23:11
camelia 5
4
3
2
1
0
next
20
21
22
23
24
25
irced m: my $seq = ( 7 ... 2 ); say $seq; 23:17
camelia (7 6 5 4 3 2)
irced m: my $seq = |( 7 ... 2 ); say $seq;
camelia (7 6 5 4 3 2)
irced m: my $seq = |( 7 ... 2 ); for $seq { say " $_ " };
camelia 7
6
5
4
3
2
irced m: my $seq = ( 7 ... 2 ); for $seq { say " $_ " }; 23:18
camelia 7 6 5 4 3 2
irced m: my $seq = |( 7 ... 2 ); say $seq.perl;
camelia $(slip(7, 6, 5, 4, 3, 2))
irced itemize a seq/range with slip, List, Array etc is my takeaway. flat doesn't work if there are sublists. 23:19
m: my $seq = ( 7 ... 2 ); for $seq<> { say " $_ " }; 23:21
camelia 7
6
5
4
3
2
irced as per the blog, apparently the Decont methodop <> is suited for this. thanks again tobs. 23:22
23:28 sauvin joined
ugexe just use `for flat $seq { }` if you want people to be able to understand your code 23:41
irced considers. 23:42
ugexe no one besides us grizzled perl6 users are going to know wtf $seq<> means
irced m: my $seq = ( (7 ... 2), (16 ... 13) ); for flat $seq { say "{$++} : $_" } 23:43
camelia 0 : 7
0 : 6
0 : 5
0 : 4
0 : 3
0 : 2
0 : 16
0 : 15
0 : 14
0 : 13
irced m: my $seq = ( (7 ... 2), (16 ... 13) ); for $seq { say "{++$}----$_" }
camelia 1----7 6 5 4 3 2 16 15 14 13
irced m: my $seq = ( (7 ... 2), (16 ... 13) ); for flat $seq { say "{++$}----$_" } 23:44
camelia 1----7
1----6
1----5
1----4
1----3
1----2
1----16
1----15
1----14
1----13
irced m: my $seq = ( (7 ... 2), (16 ... 13) ); for flat $seq { say "=={++$}== $_" }
camelia ==1== 7
==1== 6
==1== 5
==1== 4
==1== 3
==1== 2
==1== 16
==1== 15
==1== 14
==1== 13
irced m: my $seq = ( (7 ... 2), (16 ... 13) ); for flat $seq { say "=={++$}== $_ " }
camelia ==1== 7
==1== 6
==1== 5
==1== 4
==1== 3
==1== 2
==1== 16
==1== 15
==1== 14
==1== 13
irced m: my $seq = ( (7 ... 2), (16 ... 13) ); for $seq<> { say "=={++$}== $_ " }
camelia ==1== 7 6 5 4 3 2
==1== 16 15 14 13
irced m: my $seq = ( (7 ... 2), (16 ... 13) ); for |$seq { say "=={++$}== $_ " } 23:45
camelia ==1== 7 6 5 4 3 2
==1== 16 15 14 13
irced m: my $seq = ( (7 ... 2), (16 ... 13) ); for $seq<> { for $_<> { say "=={++$}== $_ " } }
camelia ==1== 7
==1== 6
==1== 5
==1== 4
==1== 3
==1== 2
==1== 16
==1== 15
==1== 14
==1== 13
irced m: my $seq = ( (7 ... 2), (16 ... 13) ); for $seq<> { for $_<> { say "=={++$}== $_ " unless ++$ = $seq.elems {say "and then"} } } 23:46
camelia 5===SORRY!5=== Error while compiling <tmp>
Unexpected block in infix position (missing statement control word before the expression?)
at <tmp>:1
------> 3 "=={++$}== $_ " unless ++$ = $seq.elems7⏏5 {say "and then"} } }
expecting …
irced m: my $seq = ( (7 ... 2), (16 ... 13) ); for $seq<> { for $_<> { say "=={++$}== $_ "; unless ++$ = $seq.elems {say "and then"} } }
camelia ==1== 7
Cannot modify an immutable Int (1)
in block at <tmp> line 1
in block <unit> at <tmp> line 1
irced m: my $seq = ( (7 ... 2), (16 ... 13) ); for $seq<> { for $_<> { say "=={++$}== $_ "; unless ++$ == $seq.elems {say "and then"} } }
camelia ==1== 7
and then
==1== 6
==1== 5
and then
==1== 4
and then
==1== 3
and then
==1== 2
and then
==1== 16
and then
==1== 15
==1== 14
and then
==1== 13
and then
irced m: my $seq = ( (7 ... 2), (16 ... 13) ); for $seq<> { for $_ { say "=={++$}== $_ "; unless ++$ == $seq.elems {say "and then"} } }
camelia ==1== 7
and then
==1== 6
==1== 5
and then
==1== 4
and then
==1== 3
and then
==1== 2
and then
==1== 16
and then
==1== 15
==1== 14
and then
==1== 13
and then
irced m: my $seq = ( (7 ... 2), (16 ... 13) ); for $seq<> { for |$_ { say "=={++$}== $_ "; unless ++$ == $seq.elems {say "and then"} } } 23:47
camelia ==1== 7
and then
==1== 6
==1== 5
and then
==1== 4
and then
==1== 3
and then
==1== 2
and then
==1== 16
and then
==1== 15
==1== 14
and then
==1== 13
and then
irced m: my $seq = ( (7 ... 2), (16 ... 13) ); for $seq<> { for |$_ { say "=={++$}== $_ "; } unless ++$ == $seq.elems {say "and then"} } }
camelia 5===SORRY!5=== Error while compiling <tmp>
Strange text after block (missing semicolon or comma?)
at <tmp>:1
------> 3seq<> { for |$_ { say "=={++$}== $_ "; }7⏏5 unless ++$ == $seq.elems {say "and then
irced m: my $seq = ( (7 ... 2), (16 ... 13) ); for $seq<> { for |$_ { say "=={++$}== $_ " }; unless ++$ == $seq.elems {say "and then"} } }
camelia 5===SORRY!5=== Error while compiling <tmp>
Unexpected closing bracket
at <tmp>:1
------> 3ss ++$ == $seq.elems {say "and then"} } 7⏏5}
irced m: my $seq = ( (7 ... 2), (16 ... 13) ); for $seq<> { for |$_ { say "--{++$}-- $_ " }; unless ++$ == $seq.elems {say "and then"} } 23:48
camelia --1-- 7
--1-- 6
--1-- 5
--1-- 4
--1-- 3
--1-- 2
and then
--1-- 16
--1-- 15
--1-- 14
--1-- 13
irced m: my $seq = ( (7 ... 2), (16 ... 13) ); for flat $seq { for |$_ { say "--{++$}-->$_ " }; unless ++$ == $seq.elems {say "and then"} }
camelia --1-->7
and then
--1-->6
--1-->5
and then
--1-->4
and then
--1-->3
and then
--1-->2
and then
--1-->16
and then
--1-->15
and then
--1-->14
and then
--1-->13
and then
irced it is hard to see, but flat does not treat the sublists individually
nevertheless, i appreciate your observation about archaic syntax
m: my $seq = ( (7 ... 2), (16 ... 13) ); for |$seq { for |$_ { say "--{++$}-->$_ " }; unless ++$ == $seq.elems {say "and then"} } 23:49
camelia --1-->7
--1-->6
--1-->5
--1-->4
--1-->3
--1-->2
and then
--1-->16
--1-->15
--1-->14
--1-->13
irced i'll stick with slip i think
m: my $seq = ( (7 ... 2), (16 ... 13) ); for |$seq { for |$_ { state $count=0; say "--{++count}-->$_ " }; unless ++$ == $seq.elems {say "and then"} } 23:50
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
count used at line 1. Did you mean 'round'?
irced m: my $seq = ( (7 ... 2), (16 ... 13) ); for |$seq { for |$_ { state $count=0; say "--{++$count}-->$_ " }; unless ++$ == $seq.elems {say "and then"} }
camelia --1-->7
--2-->6
--3-->5
--4-->4
--5-->3
--6-->2
and then
--1-->16
--2-->15
--3-->14
--4-->13
irced m: my $seq = ( ('c' ... 'h'), ( ... 13) ); for |$seq { for |$_ { state $count=0; say "--{++$count}-->$_ " }; unless ++$ == $seq.elems {say "and then"} }
camelia 13
in block <unit> at <tmp> line 1
irced m: my $seq = ( ('c' ... 'h'), ( 'p' ... 'l') ); for |$seq { for |$_ { state $count=0; say "--{++$count}-->$_ " }; unless ++$ == $seq.elems {say "and then"} } 23:51
camelia --1-->c
--2-->d
--3-->e
--4-->f
--5-->g
--6-->h
and then
--1-->p
--2-->o
--3-->n
--4-->m
--5-->l
irced sorry for the spam, anyway, ugexe, flat does not treat sublists individually in the for loop, but i see what you're saying, thanks again
23:51 sauvin left 23:52 sauvin joined
irced ugexe, though i could use flat in the innermost for loop 23:53
😄
irced gives camelia a break.
23:55 aborazmeh joined, aborazmeh left, aborazmeh joined
irced ugexe, then again, I moved the discussion beyond iterating over a sequence and the outer loop was not a sequence or a range so you're absolutely right. thanks again. 23:59