Live data from Hacker News

Lisp has too many parentheses...

symbo1ics.com

51–60 of 81 posts

Re: Lisp has too many parentheses...

#51
post #47
post #43

Money quote for the non-lisper: > For simplicity, let’s use the notation Yes, let's! Except in lisp, you can't. ;) (Yes, feeling snarky.)

Except you can, just use reader macros.

Lisp is a remarkable toolkit for creating domain-specific languages with any syntax you happen to need. It amazes me how many people try to use it as an ordinary programming language without modifying it at all, and then give up because they found nothing special about it. I think they're missing the point.

Re: Lisp has too many parentheses...

#52
post #3

Gaaah, knock off the CAPSLOCK and the machismo, please. Also, you don't need to invent backcronyms for CAR/CDR, they're now called first/rest. Having said that, I really like the presentation of your blog, nice typography. And after skimming your book[1] in progress, and noting your obvious theoretical bent and taste for rigor, I can only anticipate to read more of your future posts (latch on to something "obscure" l…

So when you call them first and rest, how do you destructure lists of lists? Actually, now that I think about it, "fire" is much cooler sounding than "cadr". But not as cool sounding as cadadr.

For me, the following is a lot more readable than cadadr:

  (def coll [[1 2 3]
             [4 5 6]
             [7 8 9]])
  (second (second coll)) ; => 5
And often when I'm digging deep inside a nested data structure, I don't need just one piece of data, so destructuring comes in handy:

  (let [[[top-left]
         [_ middle] 
         [_ _ bottom-right]] coll]
    [top-left middle bottom-right]) ; => [1 5 9]

Re: Lisp has too many parentheses...

#54

Earlier quoted context omitted.

You both have stupid arguments which basically boil down to "I don't like it because I prefer it the other way." This stupid flamewar has been fought countless times on countless online forums, let's not do this.

No... my argument is: "requiring lisp programmers to pay attemtion to formatting when they haven't had to do so for years, just to make some python developers feel more at home, is stupid." Mandating whitespace complicates the situation, and for what benifit? You're the one proposing a dramatic change, show some dramatic evidence to back up your proposition.

Mandating whitespace complicates the situation, and for what benifit? You're the one proposing a dramatic change, show some dramatic evidence to back up your proposition.

What did you not understand by "let's not do this?"

Re: Lisp has too many parentheses...

#55
post #7

Anyone manage to build a Lisp that used semantic indentation (like Python)? You could make it optional and just have it function as a preprocessor that generates the real thing.

Perhaps Haskell can be an inspiration?

A cheap hack many have used is to customize their emacs high-lighting so the parens are shown only a shade away from the background color.

Re: Lisp has too many parentheses...

#56
post #34

I always liked the way Larry Wall put it: "Lisp has all the visual appeal of oatmeal with fingernail clippings mixed in." http://groups.google.com/group/comp.lang.lisp/msg/7700fb02a2...

then he went on and desi^h^h^h^h ... crea^h^h^h^h ... hacked Perl...

Re: Lisp has too many parentheses...

#57
post #3

Gaaah, knock off the CAPSLOCK and the machismo, please. Also, you don't need to invent backcronyms for CAR/CDR, they're now called first/rest. Having said that, I really like the presentation of your blog, nice typography. And after skimming your book[1] in progress, and noting your obvious theoretical bent and taste for rigor, I can only anticipate to read more of your future posts (latch on to something "obscure" l…

The bigger problem is that CAR and CDR actually mean something without the silly anatomy analogies.

Actually, I like "anterior" and "dorsal" better than assembly instructions from the 1950s.

Re: Lisp has too many parentheses...

#58
post #39

Earlier quoted context omitted.

Maybe im to inexperienced with classic lisps, or maybe im just spoiled by clojure, but i have no idea what cadadr means, is it the rest of the first, of the rest of the first, or the other way around?

For things like cadadr, I just chop off the "c" and "r", and use the middle part to figure out the sequence of car and cdr calls. (cADADr x) = (cAr (cDr (cAr (cDr x)))), which would be (first (rest (first (rest x)))) in Clojure.

I suppose CL/Scheme programmers just learn by heart what those combinations do (ie. what kind of structure they work with), because to me both cadadr and the (first (rest ...)) sequence are equally meaningless at first glance. It's not easy to see what the data structure looks like.

In Clojure it's usually more idiomatic to use destructuring, which I think is much more understandable since the form follows the structure that is being accessed.

Or you can use get-in, which takes a sequence of keys to dig into a deep associative data structure. It doesn't work with sequences, but building highly nested seqs is rather uncommon in Clojure.

Re: Lisp has too many parentheses...

#59
post #40

Anyone manage to build a Lisp that used semantic indentation (like Python)? You could make it optional and just have it function as a preprocessor that generates the real thing.

I find this amusing because I've always found "lisp has too many parenthesis" and "python has too much significant whitespace" to be roughly equivalent in terms of relevance.

One thing that bothers me about Python's whitespace, is that it is not possible automatically indent Python code that has lost its indentation for some reason or another. You have to go back and read the original source to restore the meaning of the program even though you already have all the visible tokens it contains.

Re: Lisp has too many parentheses...

#60

Anyone manage to build a Lisp that used semantic indentation (like Python)? You could make it optional and just have it function as a preprocessor that generates the real thing.

http://srfi.schemers.org/srfi-49/srfi-49.html

I think it's a terrible idea, but there you go.

Post reply on HN