User Tools

Site Tools


ch2_1_backquote

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
ch2_1_backquote [2021/04/18 03:25] – created adminch2_1_backquote [2022/02/23 05:54] (current) admin
Line 8: Line 8:
 </code>  </code> 
  
-But in backqouted list, some parts can be switched back to evaluation with comma character (see unquote):+But in backquoted list, some parts can be switched back to evaluation with comma character (see ''UNQUOTE''):
  
 <code lisp> <code lisp>
Line 19: Line 19:
 <code lisp> <code lisp>
 >'(a ,(+ 1 2) c)         ; quoted list >'(a ,(+ 1 2) c)         ; quoted list
-(A (UNQUOTE (+ 1 2)) C)  ; form (+ 1 2) evaluated+(A (UNQUOTE (+ 1 2)) C)  ; comma character expanded, but not evaluated
 </code>  </code> 
  
-Quote form expects one argument, which is not evaluated, but switched to data and returned as is. For convenience we can use special character '' '%%%%'' for quoting, which is expanded to quote form automatically by the //reader//:+And multiple backqoutes are ignored:
  
 <code lisp> <code lisp>
-'(a c)         these expressions .. +>``(a ,(+ 1 2) c)   multiple backquoting .. 
-(quote (a b c) ; .. are the same+(A 3 C            ; .. behaves as single backquote
 </code>  </code> 
 +
 +The forms ''BACKQUOTE'', ''UNQUOTE'' and ''SPLICE-UNQUOTE'' are useful for writing macros.
 +
ch2_1_backquote.1618737903.txt.gz · Last modified: 2021/04/18 03:25 by admin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki