Below works:

mbook:~ homedir$ perl6 -e 'my $x = (44, 66); say $x; say $x.any < 43'
(44 66)
any(False, False)
#
mbook:~ homedir$ perl6 -e 'my $x = (44, 66); say $x; say $x.any < 50'
(44 66)
any(True, False)
#
mbook:~ homedir$ perl6 -e 'my $x=0; my $any=2|4|8; $x==$any ?? put "x
exists, value= $x" !! put "not there";'
not there
#
mbook:~ homedir$ perl6 -e 'my $x=4; my $any=2|4|8; $x==$any ?? put "x
exists, value= $x" !! put "not there";'
x exists, value= 4
#

HTH, Bill.

On Thu, Oct 10, 2019 at 9:30 PM Todd Chester via perl6-users
<perl6-us...@perl.org> wrote:
>
>
>
> On 10/8/19 10:53 AM, Brad Gilbert wrote:
> > Most operations with Junctions produce Junctions.
> >
> >      > 1 + any(2, 3)
> >      any(3, 4)
>
> $ p6 'say 4 + any(44,66);'
> any(48, 70)
>
> Sweet!  But what would you ever use it for?
>
> Would this be the intended use: add a number to all
> values in an array?
>
> $ p6 'my @x=[44,66]; say 4 + @x.any;'
> any(48, 70)
>
> $ p6 'my @x=[44,66]; 4 + @x.any; say @x'
> WARNINGS for -e:
> Useless use of "+" in expression "4 + @x.any" in sink context (line 1)
> [44 66]
>
>
> -T

Reply via email to