develooper Front page | perl.perl6.language | Postings from February 2004

Re: The Sort Problem: a definitive ruling

Thread Previous | Thread Next
From:
Luke Palmer
Date:
February 20, 2004 13:40
Subject:
Re: The Sort Problem: a definitive ruling
Message ID:
20040220213942.GA24478@babylonia.flatirons.org
Smylers writes:
> Luke Palmer writes:
> 
> > Uri Guttman writes:
> > 
> > > >>>>> "DC" == Damian Conway <damian@conway.org> writes:
> > 
> > >   DC>      @sorted = sort {-M}=>{$^b cmp $^a} @unsorted;
> > > 
> > > but there is no comma before @unsorted. is that correct?
> > 
> > Yes.  Commas may be ommitted on either side of a block when used as an
> > argument.
> 
> That's what I thought too.  But Damian gave exactly the opposite answer
> to Uri's question, claiming he'd made a typo and a comma would be
> required.
> 
> So which is it -- is Luke right in saying that Damian was right in the
> first place?  Or is Damian right in saying that his example was wrong?

I was wrong in saying that he was right.  Those aren't simple blocks, as
Damian said, so you need the comma.

Luke

> Smylers
> 

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