develooper Front page | perl.perl6.language | Postings from June 2005

Re: reduce metaoperator on an empty list

Thread Previous | Thread Next
From:
Luke Palmer
Date:
June 1, 2005 06:30
Subject:
Re: reduce metaoperator on an empty list
Message ID:
7ca3f01605060106304d5c29c4@mail.gmail.com
On 6/1/05, Michele Dondi <blazar@pcteor1.mi.infn.it> wrote:
> On Wed, 1 Jun 2005, Luke Palmer wrote:
> 
> >    $ordered = [<] @array;
> >
> > If @array is empty, is $ordered supposed to be true or false?   It
> > certainly shouldn't be anything but those two, because < is a boolean
> > operator.
> 
> I read that (mathematically) as "for all i, for all j such that j-i=1,
> a_i<a_j", which is certainly satisfied by an empty list.

Yep, it sure is.  Now tell Perl to read it that way for any operator.

Luke

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