Re: List Comprehension Syntax

Discussion in 'Python' started by LittleDanEhren@yahoo.com, Jul 12, 2004.

  1. Guest

    >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
     
    , Jul 12, 2004
    #1
    1. Advertising

  2. Ville Vainio Guest

    >>>>> "Danny" == LittleDanEhren <> 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
     
    Ville Vainio, Jul 12, 2004
    #2
    1. Advertising

  3. Tim Peters Guest

    []
    > 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>.
     
    Tim Peters, Jul 12, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Moosebumps

    List Comprehension Syntax

    Moosebumps, Jul 10, 2004, in forum: Python
    Replies:
    35
    Views:
    880
    David Eppstein
    Jul 22, 2004
  2. Gregory Guthrie

    list comprehension syntax..?

    Gregory Guthrie, Aug 1, 2006, in forum: Python
    Replies:
    4
    Views:
    355
    Claudio Grondi
    Aug 1, 2006
  3. Debajit Adhikary
    Replies:
    17
    Views:
    728
    Debajit Adhikary
    Oct 18, 2007
  4. Chris Mellon
    Replies:
    2
    Views:
    405
    Dustan
    Jan 18, 2008
  5. Vedran Furac(
    Replies:
    4
    Views:
    357
    Marc 'BlackJack' Rintsch
    Dec 19, 2008
Loading...

Share This Page