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

Ah, come on! The rules governing how s-expressions are made up are still SYNTAX!

But I do agree with your point ;-)



Arguably, 'syntax' is the set of rules to transform code into an Abstract Syntax Tree. Lisp's code directly represnts the AST so you could say there is no syntax (to be a little more precise I might say Lisp is homoiconic, though).


I'd still argue the textual format is not the AST itself, but a textual representation (just like any code) which is the transformed into the actual AST at parse-time using the syntax rules. Therefore, s-expressions have syntax, even if its minimal.

(x y (z a)) is code, its parsed according to the rules of the syntax and is converted to an in-memory AST representation.


You're barking up the wrong tree, pure s-exprs are a raw expression of the AST.

A much better argument would be to point to all the damn quoting operators in most Lisps, which are most definitely syntax (sugar, even).


Oh, good point, thanks! And built-in reader macros..

But really, even pure s-exprs are just one possible textual representation f an AST. Hell, XML is a valid representation too. Anything thats a representation of something follows rules as to how its represented and if it has rules, then its got syntax.

But.. you're right, arguing about the s-exprs part isn't going to get me anywhere. The Lisp weenies* will always believe Lisp has no syntax (blatantly ignoring the quoting operator which you mentioned) and nobody else really cares, so...

* I'm not trying to knock Lisp; I actually quite like Scheme and Clojure (and probably would like Common Lisp too, if I'd spent more time with it). I just think this whole "it has no syntax, yet I have to follow these precise syntactical rules" stuff is stupid. ;-)




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

Search: