(func arg1 arg2 (func arg3))
That's the syntax of function calls.But Lisp has a few special forms and zillions of macros. Most of them are syntax. Lisp has IF. What is the syntax of IF? IF form then-form else-form+
Lisp has COND. What is the syntax of COND? cond {clause}*
clause::= (test-form form*)
List has DEFUN. What is the syntax of DEFUN? defun function-name lambda-list [[declaration* | documentation]] form*
Now what is the syntax for LAMBDA-LIST? lambda-list::= (var*
[&optional {var | (var [init-form [supplied-p-parameter]])}*]
[&rest var]
[&key {var | ({var | (keyword-name var)} [init-form [supplied-p-parameter]])}* [&allow-other-keys]]
[&aux {var | (var [init-form])}*])
and so on...> It's one of the strengths of Lisp imo; that you don't need to think much about how the parser is going to interpret your code (ie. missing semi-colons, whitespace, use curly brace here, square bracket there, etc.), just stick to (func arg1 arg2) and all you're left with is your own logic errors. What you describe is just the data syntax for s-expressions. Not the syntax of the programming language Lisp. |
Exactly. The data syntax if what most people worry about. The names of the verbs (funcs/methods/etc.) may change from language to language, but the data syntax is what trips people up. I think Lisp has one of the simplest and clearest. There are very few cases of "oh you can't write that there, only nouns are allowed in that position".
I agree with your point, but I think we're arguing slightly different points here ;)