ch2_1_unquote
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
ch2_1_unquote [2021/04/18 03:46] – created admin | ch2_1_unquote [2022/02/25 01:47] (current) – admin | ||
---|---|---|---|
Line 6: | Line 6: | ||
>(setq b 3) ; set value of symbol B | >(setq b 3) ; set value of symbol B | ||
3 | 3 | ||
- | >`(a ,b c) ; unquoted | + | >`(a ,b c) ; unquoted |
(A 3 C) ; symbols A and C are not evaled, but B is | (A 3 C) ; symbols A and C are not evaled, but B is | ||
- | </ | + | </ |
+ | The last command is expanded to | ||
+ | <code lisp> | ||
+ | > | ||
+ | </ | ||
+ | |||
+ | Following example was shown for backquote: | ||
<code lisp> | <code lisp> | ||
- | >(setq b 3) ; set value of symbol B | + | >`(a ,(+ 1 2) c) ; backquoted list |
- | 3 | + | (A 3 C) |
- | >`(a ,b c) ; unquoted b | + | |
- | (A 3 C) | + | |
</ | </ | ||
+ | |||
+ | If the evaluated element results in list, with unquoting it becomes sub-list of the backqouted list. | ||
+ | |||
+ | <code lisp> | ||
+ | >`(a ,(list 1 2) c) ; function LIST produces list | ||
+ | (A (1 2) C) ; list (1 2) as sublist | ||
+ | </ | ||
+ | |||
+ | Important is that if we unqoute pre-existing list, this original list will become sublist, not a copy. '' | ||
+ | |||
+ | See splice-unquote for further refinement. The forms '' | ||
+ | |||
+ |
ch2_1_unquote.1618739162.txt.gz · Last modified: 2021/04/18 03:46 by admin