Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: List Comprehension Syntax

Reply
Thread Tools

Re: List Comprehension Syntax

 
 
LittleDanEhren@yahoo.com
Guest
Posts: n/a
 
      07-12-2004
>Luckily, the underlying model of LCs is very well understood (map &
>filter), and solving things the list-processing way is a time-honed
>practice. In the "amaze your friends" front, LCs are more in the "look
>how elegant and concise this can be" genre, not in the "check this
>out, all recursion and no variables, I bet you can't get it even after
>staring it for 5 minutes" genre loved by some academics.


I'd like to point out that list comprehensions were invented by people
who you'd probably put in that genre of academics, namely the creators
of Haskell. I don't really list comprehensions because the syntax is
too specific. In Kogut, a functional language that you'd probably
dismiss as being made by academics because it's functional, the syntax
for the original list comprehension at the beginning of the thread
would be
let result = Filter list ?elem {Part elem 0 4 == "blah"}
->Map (ReplacePart _ "moof" 0 4)
This syntax is very conducive to splitting up into multiple lines and
doesn't require much more explanation than list comprehensions do. I
really hate it when people say that academics are making programming
languages that are really hard to read; it reflects on the speaker's
stupidity more than anything else.

Daniel Ehrenberg

 
Reply With Quote
 
 
 
 
Ville Vainio
Guest
Posts: n/a
 
      07-12-2004
>>>>> "Danny" == LittleDanEhren <(E-Mail Removed)> writes:

Danny> I'd like to point out that list comprehensions were
Danny> invented by people who you'd probably put in that genre of
Danny> academics, namely the creators

Of course, and lots of other stuff too. Academics have great ideas,
and bad ideas. The stuff that flies is adopted in the industry, stuff
that doesn't is not. I'm by no means dismissing all academic research
on software as worthless (quite on the contrary) - especially when
it's research of new stuff. MIT and UCB have given us some great
things.

Danny> comprehensions do. I really hate it when people say that
Danny> academics are making programming languages that are really
Danny> hard to read; it reflects on the speaker's stupidity more
Danny> than anything else.

Indeed. 80% of software engineers should be suffocated silently in the
night, resulting in a master race of programmers (after 3-4
generations of breeding) that could reimplement all the software in
existence today with purely recursive algorithms. I bet the software
available then would rock.

--
Ville Vainio http://tinyurl.com/2prnb
 
Reply With Quote
 
 
 
 
Tim Peters
Guest
Posts: n/a
 
      07-12-2004
[(E-Mail Removed)]
> I'd like to point out that list comprehensions were invented by people
> who you'd probably put in that genre of academics, namely the creators
> of Haskell.


Na, Haskell's creators adapted them from the older SETL language, who
in turn were inspired by set theory's so-called Axiom of Comprehension
(which is why they're called "comprehensions" to begin with).

Of course that doesn't detract from your point that the OP would class
them as academics <wink>.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
List comprehension in if clause of another list comprehension Vedran Furac( Python 4 12-19-2008 01:35 PM
Re: strange syntax rules on list comprehension conditions Chris Mellon Python 2 01-18-2008 11:44 PM
Appending a list's elements to another list using a list comprehension Debajit Adhikary Python 17 10-18-2007 06:45 PM
list comprehension syntax..? Gregory Guthrie Python 4 08-01-2006 07:38 PM
List Comprehension Syntax Moosebumps Python 35 07-22-2004 05:45 PM



Advertisments