Re: Chained sequence operators

2018-01-26 Thread ToddAndMargo
On 01/26/2018 01:51 PM, Brandon Allbery wrote: You probably want an enum to get that behavior. Strings are strings; Perl has no idea what they mean. Larry is a cleaver guy, so I was pushing the envelope! :-)

Re: Chained sequence operators

2018-01-26 Thread Brandon Allbery
You probably want an enum to get that behavior. Strings are strings; Perl has no idea what they mean. On Fri, Jan 26, 2018 at 4:45 PM, ToddAndMargo wrote: > Sweet! > $ perl6 -e 'my $x=(1...5...1); say $x;' > (1 2 3 4 5 4 3 2 1) > > Characters too! > $ perl6 -e 'my $x=("a"..."f"..."a"); say $x;'

Re: Chained sequence operators

2018-01-26 Thread ToddAndMargo
Sweet! $ perl6 -e 'my $x=(1...5...1); say $x;' (1 2 3 4 5 4 3 2 1) Characters too! $ perl6 -e 'my $x=("a"..."f"..."a"); say $x;' (a b c d e f e d c b a) Ah Shucks (ah poop)! $ perl6 -e 'my $x=("Monday"..."Friday"); say $x;' (Monday Momday Molday Mokday Mojday Moiday Mpnday Mpmday Mplday Mpkday

Re: Chained sequence operators

2018-01-26 Thread Larry Wall
The most detailed description of ... is still to be found starting down a few paragraphs in the https://design.perl6.org/S03.html#List_infix_precedence section. In general the operators have not suffered as much "spec rot" as some other parts of the "speculations" known as Synopses, so most of S0

Chained sequence operators

2018-01-26 Thread Sean McAfee
Today I stumbled across the fact that the sequence operator can be chained: > 1...5...1 (1 2 3 4 5 4 3 2 1) You can even reduce with it: > [...] 1, 5, 3, 10, 8 (1 2 3 4 5 4 3 4 5 6 7 8 9 10 9 8) And even sequences with custom generators can be joined: > 0,1,*+*...144,*/2...9 (0 1 1 2 3 5 8 13