develooper Front page | perl.perl6.language | Postings from July 2010

Re: Suggested magic for "a" .. "b"

Thread Previous | Thread Next
From:
Larry Wall
Date:
July 21, 2010 02:21
Subject:
Re: Suggested magic for "a" .. "b"
Message ID:
20100721092058.GA19179@wall.org
On Tue, Jul 20, 2010 at 11:53:27PM -0400, Mark J. Reed wrote:
: In particular, consider that pi ~~ 0..4 is true,
:  because pi is within the range; but pi ~~ 0...4 is false, because pi
: is not one of the generated elements.

Small point here, it's not because pi is fractional: 3 ~~ 0...4 is
also false because 3 !eqv (0,1,2,3,4).  There is no implicit any()
on a smartmatch list pattern as there is in Perl 5.  In Perl 6 the
pattern 0..4 may only match a list with the same 5 elements in the
same order.

Larry

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