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:
William Michels via perl6-users
Date:
October 12, 2019 03:09
Subject:
Re: Match operator: error with any() junction and user-defined $_topic variable
Message ID:
CAA99HCzvV9-AB62KdPR8y25KjbXNoy161OsHrkzvWsVnERUPbw@mail.gmail.com
Hi Todd, Per the REPL, $x looks to be a List:

mbook:~ homedir$ perl6
To exit type 'exit' or '^D'
>
> my $x = (44,66)
(44 66)
> say $x.WHAT
(List)
> say $x.^name
List
>
> my $y = < 55 77 >
(55 77)
> say $y.WHAT
(List)
> say $y.^name
List
>
> say $*VM
moar (2019.07.1)

HTH, Bill.


On Fri, Oct 11, 2019 at 4:24 PM ToddAndMargo via perl6-users
<perl6-users@perl.org> wrote:
>
> On 10/11/19 2:46 AM, William Michels via perl6-users wrote:
> > 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.
>
> Sweet.  Love examples.  Thank you!
>
> Question:  what type is "my $x = (44, 66)".   An array?

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