Yeah, I figured that out right after I had posted my message...

But still, you can see that the python syntax is quite a bit more
readable ( at least in this case ).

j.

On 8/4/05, David A. Black <dblack / wobblini.net> wrote:
> Hi --
> 
> On Thu, 4 Aug 2005, Jeff Wood wrote:
> 
> > but beyond that, they have a cool conditional clause for the comprehensions...
> >
> > [ item*2 for item in items if item > 2 ]
> >
> > ... which lets you run a conditional filter, and then a procedure on
> > the elements that passed.
> >
> > which would be the same as:
> >
> > temp = items.select { |item| item > 2 }
> > temp.collect { |item| item*2 }
> 
> You don't need 'temp' there:
> 
>   items.select {|item| item > 2 }.map {|item| item * 2 }
> 
> 
> David
> 
> --
> David A. Black
> dblack / wobblini.net
> 
> 


-- 
"So long, and thanks for all the fish"

Jeff Wood