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

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

Thread Previous | Thread Next
From:
yary
Date:
July 28, 2010 10:28
Subject:
Re: Suggested magic for "a" .. "b"
Message ID:
AANLkTinJBJD=2vsov529J4vwzZTOuqjuE6w+m76w26HP@mail.gmail.com
> Swapping the endpoints could mean swapping inside test to outside
> test. The only thing that is needed is to swap from && to ||:
>
> $a .. $b # means $a <= $_ && $_ <= $b if $a < $b
> $b .. $a # means $b <= $_ || $_ <= $a if $a < $b

I think that's what "not", "!" are for!

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