What is the role of the @ character in Emacs Lisp?

前端 未结 2 1429
梦谈多话
梦谈多话 2021-01-19 03:51

As used for instance in this macro definition:

(defmacro with-eval-after-load-feature (feature &rest body)
  (declare (indent 1) (debug t))
  (let* ((fea         


        
相关标签:
2条回答
  • 2021-01-19 04:22

    Asking Emacs is always a sensible approach:

    • C-hig (elisp) RET
    • I @ RET

    This shows you all the elisp manual's index entries for @ (one of which is the ,@ you were actually looking for).

    0 讨论(0)
  • 2021-01-19 04:24

    It's used for splicing in backquoted expressions. See C-h i g (elisp) Backquote RET. For example:

    elisp> `(1 2 ,(list 3 4))  ; no splicing => nested list
    (1 2
       (3 4))
    
    elisp> `(1 2 ,@(list 3 4)) ; splicing => flat list
    (1 2 3 4)
    
    0 讨论(0)
提交回复
热议问题