develooper Front page | perl.perl6.language | Postings from September 2002

Re: Regex query

From:
Tanton Gibbs
Date:
September 20, 2002 16:45
Subject:
Re: Regex query
Message ID:
015e01c260ff$88e17880$f8ffa8c0@brooklyn
> > This kind of clever magic always makes me nervous:
> > it introduces subtle bug potentials.
> >
> >   (7,8,9) == 3 # true
> >   (7,8)   == 2 # true
> >   (7)     == 1 # false
> >   ()      == 0 # true?
> 
> I believe the last two cases should be:
> 
>     (7,)    == 1
>     (,)     == 0
> 
> Because its the perl6 comma that creates the list, not the parenthesis.
> 
> ~ John Williams

If this is the case, then can you also have:

 (,7)

What is its length?

Tanton




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