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

Re: reduce metaoperator on an empty list

Thread Previous | Thread Next
Luke Palmer
June 1, 2005 06:30
Re: reduce metaoperator on an empty list
Message ID:
On 6/1/05, Michele Dondi <> 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.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About