develooper Front page | perl.perl6.users | Postings from October 2019

Re: Match operator: error with any() junction and user-defined $_topic variable

Thread Previous | Thread Next
From:
Todd Chester via perl6-users
Date:
October 11, 2019 04:30
Subject:
Re: Match operator: error with any() junction and user-defined $_topic variable
Message ID:
911f7381-671d-1409-9875-33d6af7ee45c@zoho.com


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

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About