use correct names for quasiquotation operators
authorBrian Templeton <bpt@hcoop.net>
Sat, 10 Jul 2010 00:33:32 +0000 (20:33 -0400)
committerAndy Wingo <wingo@pobox.com>
Tue, 7 Dec 2010 12:21:02 +0000 (13:21 +0100)
Use #{`}#, #{,}# and #{,@}# as the quasiquote, unquote and
unquote-splicing operators, respectively. Previously they were named
escaping.

* module/language/elisp/compile-tree-il.scm (unquote?): Change "\," to
  "#{,}#".
  (unquote-splicing): Change "\,@" to "#{,@}#".
  (#{compile-`}#): Rename from #{compile-\`}#.
* module/language/elisp/runtime/function-slot.scm: Import #{compile-`}#
  instead of #{compile-\`}#, and re-export as #{`}# instead of as
  #{\`}#.
* module/language/elisp/parser.scm (quotation-symbols):
* test-suite/tests/elisp-compiler.test ("Eval", "Quotation"):
* test-suite/tests/elisp-reader.test ("Parser"): Change "\`", "\,", and
  "\,@" to "#{`}#", "#{,}#" and "#{,@}#", respectively.

module/language/elisp/compile-tree-il.scm
module/language/elisp/parser.scm
module/language/elisp/runtime/function-slot.scm
test-suite/tests/elisp-compiler.test
test-suite/tests/elisp-reader.test

index cb2271a..18a62e8 100644 (file)
@@ -49,7 +49,7 @@
             compile-function
             compile-defmacro
             compile-defun
-            compile-\`
+            #{compile-`}#
             compile-quote))
 
 ;;; Certain common parameters (like the bindings data structure or
 ;;; unquote/unquote-splicing/backquote form.
 
 (define (unquote? sym)
-  (and (symbol? sym) (eq? sym '\,)))
+  (and (symbol? sym) (eq? sym '#{,}#)))
 
 (define (unquote-splicing? sym)
-  (and (symbol? sym) (eq? sym '\,@)))
+  (and (symbol? sym) (eq? sym '#{,@}#)))
 
 ;;; Build a call to a primitive procedure nicely.
 
                                                              body))
                               (make-const loc name)))))))
 
-(defspecial \` (loc args)
+(defspecial #{`}# (loc args)
   (pmatch args
     ((,val)
      (process-backquote loc val))))
index 188b296..baac7f7 100644 (file)
 ;;; routine in our recursive-descent parser.
 
 (define quotation-symbols '((quote . quote)
-                            (backquote . \`)
-                            (unquote . \,)
-                            (unquote-splicing . \,@)))
+                            (backquote . #{`}#)
+                            (unquote . #{,}#)
+                            (unquote-splicing . #{,@}#)))
 
 (define (get-expression lex)
   (let* ((token (lex 'get))
index 19ef351..1e5ffed 100644 (file)
@@ -55,7 +55,7 @@
                  (compile-function . function)
                  (compile-defun . defun)
                  (compile-defmacro . defmacro)
-                 (compile-\` . \`)
+                 (#{compile-`}# . #{`}#)
                  (compile-quote . quote)))
   #:duplicates (last)
   ;; special operators
@@ -78,7 +78,7 @@
                function
                defun
                defmacro
-               \`
+               #{`}#
                quote)
   ;; macros
   #:re-export (lambda
index 61b6f5f..df22afe 100644 (file)
     (progn (setq depth 10 i depth)
            (setq code '(eval 0))
            (while (not (zerop i))
-             (setq code (\` (eval (quote (1+ (\, code))))))
+             (setq code (#{`}# (eval (quote (1+ (#{,}# code))))))
              (setq i (1- i)))
            (= (eval code) depth))))
 
          (equal '(1 2 . 3) '(1 2 . 3))))
 
   (pass-if "simple backquote"
-    (and (equal (\` 42) 42)
-         (equal (\` (1 (a))) '(1 (a)))
-         (equal (\` (1 . 2)) '(1 . 2))))
+    (and (equal (#{`}# 42) 42)
+         (equal (#{`}# (1 (a))) '(1 (a)))
+         (equal (#{`}# (1 . 2)) '(1 . 2))))
   (pass-if "unquote"
     (progn (setq a 42 l '(18 12))
-           (and (equal (\` (\, a)) 42)
-                (equal (\` (1 a ((\, l)) . (\, a))) '(1 a ((18 12)) . 42)))))
+           (and (equal (#{`}# (#{,}# a)) 42)
+                (equal (#{`}# (1 a ((#{,}# l)) . (#{,}# a))) '(1 a ((18 12)) . 42)))))
   (pass-if "unquote splicing"
     (progn (setq l '(18 12) empty '())
-           (and (equal (\` (\,@ l)) '(18 12))
-                (equal (\` (l 2 (3 (\,@ l)) ((\,@ l)) (\,@ l)))
+           (and (equal (#{`}# (#{,@}# l)) '(18 12))
+                (equal (#{`}# (l 2 (3 (#{,@}# l)) ((#{,@}# l)) (#{,@}# l)))
                        '(l 2 (3 18 12) (18 12) 18 12))
-                (equal (\` (1 2 (\,@ empty) 3)) '(1 2 3))))))
+                (equal (#{`}# (1 2 (#{,@}# empty) 3)) '(1 2 3))))))
       
 
 
index 9832903..cf7c15c 100644 (file)
@@ -163,7 +163,7 @@ test\"ab\"\\ abcd
     (and (equal? (parse-str "'(1 2 3 '4)")
                  '(quote (1 2 3 (quote 4))))
          (equal? (parse-str "`(1 2 ,3 ,@a)")
-                 '(\` (1 2 (\, 3) (\,@ a))))))
+                 '(#{`}# (1 2 (#{,}# 3) (#{,@}# a))))))
 
   (pass-if "lists"
     (equal? (parse-str "(1 2 (3) () 4 (. 5) (1 2 . (3 4)) (1 . 2) . 42)")