Konubinix' opinionated web of thoughts

Flatten Lists in Emacs Lisp Using ,@

fleeting

flatten lists in emacs lisp using ,@

Taken from the emacs lisp info.

You can also “splice” an evaluated value into the resulting list, using the special marker `,@’. The elements of the spliced list become elements at the same level as the other elements of the resulting list. The equivalent code without using ``’ is often unreadable. Here are some examples:

(setq some-list '(2 3))
=> (2 3)
(cons 1 (append some-list '(4) some-list))
=> (1 2 3 4 2 3)
`(1 ,@some-list 4 ,@some-list)
=> (1 2 3 4 2 3)