Hacker News new | past | comments | ask | show | jobs | submit login

macro 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.



They 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]





Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: