Using two backquotes and commas, Common Lisp

前端 未结 2 1319
被撕碎了的回忆
被撕碎了的回忆 2020-12-29 06:31

I\'m learning common lisp and I have a problem with understanding the usage of two backquotes combined with two commas:

``(a ,,(+ 1 2))

I m

2条回答
  •  长发绾君心
    2020-12-29 06:34

    No, both commas were consumed. There were two levels of quoting and two levels of commas. Now there's one level of quoting and one level of commas. In fact, GNU Common Lisp (2.44.1) evaluates your expression as

    (list 'a 3)
    

    That's exactly the same thing as

    `(a ,3)
    

    but more explicitly has "evaluated" both commas.

提交回复
热议问题