Re: Easy question: what is a "list comprehension" ?

2008-04-05 Thread Luke Palmer
On Sat, Apr 5, 2008 at 7:32 PM, Brandon S. Allbery KF8NH <[EMAIL PROTECTED]> wrote> > On Apr 5, 2008, at 15:07 , John M. Dlugosz wrote: > > > What is a "list comprehension"? I've seen that term bantered around here. > > > > The term comes from Haskell and Python; it's a shorthand notation for li

Re: Easy question: what is a "list comprehension" ?

2008-04-05 Thread Brandon S. Allbery KF8NH
On Apr 5, 2008, at 15:07 , John M. Dlugosz wrote: What is a "list comprehension"? I've seen that term bantered around here. The term comes from Haskell and Python; it's a shorthand notation for list generation and filtering. [x | x <- some expression involving y, y = some range exp

Re: Easy question: what is a "list comprehension" ?

2008-04-05 Thread Chas. Owens
On Sat, Apr 5, 2008 at 3:07 PM, John M. Dlugosz <[EMAIL PROTECTED]> wrote: > What is a "list comprehension"? I've seen that term bantered around here. snip It is like a list, for loop, and grep all rolled up into one. Here is what it looks like in Python: S = [2*x for x in xrange(100) if x**2 >