4 ms·
Well, that opens up a whole new can of syntax worms... But yeah, all of this stuff just makes me more convinced that Lisp syntax is the best ever.
by mbrock 11y ago
Well, that opens up a whole new can of syntax worms...
But yeah, all of this stuff just makes me more convinced that Lisp syntax is the best ever.
- naveen99 11y agoLisp uses comas in macro evaluation, but not lists and dictionaries. Then you have reader macros. Lisp syntax can be arbitrarily complex.
- mbrock 11y agoIt's not that the symbol comma is bad. Lisp uses it as a prefix to unquote a form, which is totally different from the use as a separator.
- kazinator 11y agoThe commas do something in backquote syntax! They are operators, effectively. In the Scheme backquote (dubbed quasiquote), the spec says that the read syntax ,X produces (unquote X). You can omit the comma, and then you just have X. This is totally different from a comma which just punctuates syntax.
- lispm 11y agomacro and comma is fully unrelated. The comma in backquote expressions is not even limited to lists. Commas are used in backquote forms to force evaluation. For example one can write a vector of three elements, where the second element is computed: `#(1 ,(first *features*) b) Backquote list forms happen to be used in some macros as a kind of template forms. Macros can be defined without them and backquote forms are also used elsewhere in Lisp.
- kazinator 11y agoThey are not "fully unrelated". The backquote syntax for constructing lists was primarily designed for macro programming. See the paper Evolution of Lisp by Guy Steele and Peter Gabriel: "Macros took a major step forward with Lisp-Machine Lisp, which consolidated the various macro-defining techniques into two standardized features that were adopted throughout the MacLisp community and eventually into Common Lisp. The macro defining operator DEFMACRO provided list-structure destructuring to arbitrary depth; the backquote feature provided a convenient and concise pseudo-quoting facility. [ ... ] Backquote and DEFMACRO made a big difference. This leap in expressive power, made available in a standard form, began a new surge of language extension [...]" [3.3]
- lispm 11y agohttp://repository.readscheme.org/ftp/papers/pepm99/bawden.pdf http://repository.readscheme.org/ftp/papers/pepm99/bawden.pd...