]> gitweb.factorcode.org Git - factor.git/commitdiff
Working on quasi-quoted forms
authorJames Cash <james.nvc@gmail.com>
Wed, 4 Jun 2008 16:47:53 +0000 (12:47 -0400)
committerJames Cash <james.nvc@gmail.com>
Thu, 5 Jun 2008 08:16:34 +0000 (04:16 -0400)
extra/lisp/lisp.factor

index 616efcbb1dc1978302cd8bf43b94d35d794a6f1e..00d7b3cf9574779e78496757172e287e0a341591 100644 (file)
@@ -60,10 +60,18 @@ PRIVATE>
 : convert-quoted ( cons -- quot )  
     cdr 1quotation ;
     
+: convert-unquoted ( cons -- quot )    
+    "unquote not valid outside of quasiquote!" throw ;
+    
+: convert-quasiquoted ( cons -- newcons )
+    [  ] traverse ;
+    
 : form-dispatch ( lisp-symbol -- quot )
     name>>
     { { "lambda" [ convert-lambda ] }
       { "quote" [ convert-quoted ] }
+      { "unquote" [ convert-unquoted ] }
+      { "quasiquote" [ convert-quasiquoted ] }
       { "if" [ convert-if ] }
       { "begin" [ convert-begin ] }
       { "cond" [ convert-cond ] }
@@ -125,4 +133,4 @@ M: no-such-var summary drop "No such variable" ;
     name>> macro-env get at ;
     
 : lisp-macro? ( car -- ? )
-    dup lisp-symbol? [ name>> macro-env get key? ] [ drop f ] if ;
\ No newline at end of file
+    dup lisp-symbol? [ name>> macro-env get key? ] [ drop f ] if ;