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!
:-)
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;'
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
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
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
On Wed, 27 Sep 2017 07:09:16 -0700, c...@zoffix.com wrote:
> Here, instead of the Failure, the $_ is an Any:
>
> 13:59 m: sub x { my $ver = .lines.uc with "blazr".IO.open
> orelse note "meow {.exception.message}" and return 42; "meow$ver" };
> dd x
> 13:59 camelia rakudo-moar 9
On Mon, 21 Dec 2015 13:33:51 -0800, masak wrote:
> m: sub foo($x) { say (* == $x)($_) given $x }; foo(1); foo(2)
> rakudo-moar cfb1f3: OUTPUT«TrueFalse»
> * masak submits rakudobug
>
> Examining the expression printed, it basically says "$x should be
> numerically equal to itself" in a circuit
On Mon, 21 Dec 2015 13:33:51 -0800, masak wrote:
> m: sub foo($x) { say (* == $x)($_) given $x }; foo(1); foo(2)
> rakudo-moar cfb1f3: OUTPUT«TrueFalse»
> * masak submits rakudobug
>
> Examining the expression printed, it basically says "$x should be
> numerically equal to itself" in a circuit
On Tue, 03 Oct 2017 09:38:23 -0700, b...@abrij.org wrote:
> On Mon, 02 Oct 2017 19:08:27 -0700, alex.jakime...@gmail.com wrote:
> > Also worth taking a look at
> > https://rt.perl.org/Ticket/Display.html?id=126569
> >
> > On 2017-09-29 14:06:58, b...@abrij.org wrote:
> > > On Sun, 28 May 2017 00:0
On Wed, 27 Sep 2017 07:09:16 -0700, c...@zoffix.com wrote:
> Here, instead of the Failure, the $_ is an Any:
>
> 13:59 m: sub x { my $ver = .lines.uc with "blazr".IO.open
> orelse note "meow {.exception.message}" and return 42; "meow$ver" };
> dd x
> 13:59 camelia rakudo-moar 9
On Tue, 20 Oct 2015 18:11:22 -0700, larry wrote:
> This works:
>
> > p6 'given 10 { say (* + $_)(32) }'
> 42
>
> but this doesn't:
>
> > p6 'say (* + $_)(32) given 10'
> Use of uninitialized value of type Any in numeric context in whatevercode
> at -e:1
> 32
Thank you for the report. This is
On Tue, 20 Oct 2015 18:11:22 -0700, larry wrote:
> This works:
>
> > p6 'given 10 { say (* + $_)(32) }'
> 42
>
> but this doesn't:
>
> > p6 'say (* + $_)(32) given 10'
> Use of uninitialized value of type Any in numeric context in whatevercode
> at -e:1
> 32
Thank you for the report. This is
On Tue, 03 Oct 2017 09:38:23 -0700, b...@abrij.org wrote:
> On Mon, 02 Oct 2017 19:08:27 -0700, alex.jakime...@gmail.com wrote:
> > Also worth taking a look at
> > https://rt.perl.org/Ticket/Display.html?id=126569
> >
> > On 2017-09-29 14:06:58, b...@abrij.org wrote:
> > > On Sun, 28 May 2017 00:0
On Tue, 03 Oct 2017 08:07:41 -0700, c...@zoffix.com wrote:
> IRC: https://irclog.perlgeek.de/perl6/2017-10-03#i_15250878
>
> Reads "aaa", not "abc":
> 15:05 Zoffix m: for { $^v.uc andthen say $v orelse .say }
> 15:05 camelia rakudo-moar f946bd: OUTPUT: «aaa»
>
> But
On Thu, 05 Nov 2015 01:58:17 -0800, sml...@gmail.com wrote:
> This works:
>
> ➜ .pick xx 10 given 1..6
> (6 3 1 1 5 1 6 3 4 2)
>
> But putting parens around the xx operation, breaks it:
>
> ➜ (.pick xx 10) given 1..6
> ((Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any))
>
> The proble
On Fri, 09 Jun 2017 12:48:55 -0700, c...@cpan.org wrote:
> Example code:
>
> $ cat bug.p6
> for ^7 {
> my $x = 1;
> 1 andthen print "$x "
> andthen $x = 2
> andthen $x = 3
> andthen $x = 4;
> }
>
> Output:
>
> $ perl6 bug.p6
> 1 4 3 3 3 3 3
>
> We apparently create a c
On Tue, 17 Jan 2017 10:04:11 -0800, c...@zoffix.com wrote:
> m: sub itcavuc ($c) { (try say $c) andthen 42 }; itcavuc $_
> for 2, 4, 6
> rakudo-moar 7d5bbe: OUTPUT«246»
> m: sub itcavuc ($c) { try {say $c} andthen 42 }; itcavuc $_
> for 2, 4, 6
> rakudo-moar 7d5bbe: OUTPUT«224»
>
> The b
On Tue, 17 Jan 2017 10:04:11 -0800, c...@zoffix.com wrote:
> m: sub itcavuc ($c) { (try say $c) andthen 42 }; itcavuc $_
> for 2, 4, 6
> rakudo-moar 7d5bbe: OUTPUT«246»
> m: sub itcavuc ($c) { try {say $c} andthen 42 }; itcavuc $_
> for 2, 4, 6
> rakudo-moar 7d5bbe: OUTPUT«224»
>
> The b
On Tue, 03 Oct 2017 08:07:41 -0700, c...@zoffix.com wrote:
> IRC: https://irclog.perlgeek.de/perl6/2017-10-03#i_15250878
>
> Reads "aaa", not "abc":
> 15:05 Zoffix m: for { $^v.uc andthen say $v orelse .say }
> 15:05 camelia rakudo-moar f946bd: OUTPUT: «aaa»
>
> But
On Sat, 21 Oct 2017 06:23:40 -0700, sml...@gmail.com wrote:
> Golfed example:
>
> sub foo ($str) {
> { say $str }() orelse Nil
> }
>
> foo "aa"; # aa
> foo "bb"; # aa
>
> The second call should print "bb", not "aa".
>
> Replacing the `say` with `return`, throws "A
On Fri, 09 Jun 2017 12:48:55 -0700, c...@cpan.org wrote:
> Example code:
>
> $ cat bug.p6
> for ^7 {
> my $x = 1;
> 1 andthen print "$x "
> andthen $x = 2
> andthen $x = 3
> andthen $x = 4;
> }
>
> Output:
>
> $ perl6 bug.p6
> 1 4 3 3 3 3 3
>
> We apparently create a c
On Sat, 21 Oct 2017 06:23:40 -0700, sml...@gmail.com wrote:
> Golfed example:
>
> sub foo ($str) {
> { say $str }() orelse Nil
> }
>
> foo "aa"; # aa
> foo "bb"; # aa
>
> The second call should print "bb", not "aa".
>
> Replacing the `say` with `return`, throws "A
On Thu, 05 Nov 2015 01:58:17 -0800, sml...@gmail.com wrote:
> This works:
>
> ➜ .pick xx 10 given 1..6
> (6 3 1 1 5 1 6 3 4 2)
>
> But putting parens around the xx operation, breaks it:
>
> ➜ (.pick xx 10) given 1..6
> ((Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any))
>
> The proble
23 matches
Mail list logo