What advantage does common lisp reader macros have that Clojure does not have?

前端 未结 3 1311
情歌与酒
情歌与酒 2020-12-30 04:00

I have been using Clojure alot recently but I still don\'t understand what functionality I do not get that common lisp reader macros provide. Can explain explain this to me

3条回答
  •  南方客
    南方客 (楼主)
    2020-12-30 04:40

    A simple example. Common Lisp has a different reader syntax for vectors #() instead of []. But with the ability to create custom reader macros you can have a reader macro that traslates [2 3 4 5] to a vector in Common Lisp as well.

    Since most users won't be aware of the meaning of reader macros one has created they are rarely used and to avoid the confusion altogether Rich Hickey decided to remove the ability to have user defined reader macros in Clojure. Clojure, however, has predefined reader macros - quote, vector, regex, map, etc

提交回复
热议问题