Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

We have to try to understand the non-strawman position of those who are genuinely turned off by Lisp syntax. The problem for them isn't the position of the parenthesis or the lack of commas: those things are probably fine for almost everyone.

In Lisps, this notation represents all structures in the program: definitions of functions, types and variables, control statements and so on.

For the users who have some kind of problem with that, it wouldn't be any better with the op(arg, ...) notation; and I suspect that most would agree that it's even worse.

(For that matter, most programmers don't actually have experience nesting the f(x, y, ...) notation to the same depth that is seen in Lisp programs. Anyone comparing a simple one-or-two-liner f(x, y, ...) with a modicum of nesting to Lisp code that runs for pages and pages is doing apples and oranges.)



Clojure takes this criticism to heart, and at least uses different delimiters for indicate different kinds of syntactic structures. Like () for classic lists, [] for arrays, {} for maps. Helps with visually detecting different kinds of structures in your code.


Clojure also prunes the excessive parentheses whenever the structure is obvious from context. E.g. "(let ((a 1) (b 2)) ...)" becomes "(let [a 1 b 2] ...)" and Clojure just requires an even number of elements so that the pairing can be inferred.


Common Lisp has this in the `setq` and `psetq` macros. E.g. exchange `x` and `y`:

  (psetq x y y x)
You can easily have a nesting reduced binding macro, like (var (x 1 y 1) (list x y)), with sequential binding.

Untested:

  (defmacro var (pairs &body body)
    (if (oddp (length pairs))
      (error "~s: variables and init-forms must occur pairwise" 'var))
    `(let* ,(loop for (var init) on pairs by #'cddr
                  unless (and var (symbolp var)
                              (not (eql var t))
                              (not (keywordp var)))
                  do
                    (error "~s: ~s isn't a variable name" 'var var)
                  collect (list var init))
       ,@body)))


Sadly, I'm not convinced that there is much more than the straw man, honestly. Folks are predisposed to think it is a hard to read language. And this is on large because everyone says so.

Similarly, python. Is only a readable language because the community insists it is.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: