[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

question about Quasiquote



   Date: Mon, 12 Apr 1993 21:10:28 -0400
   From: Matthias Blume <blume@cs.Princeton.EDU>

   This rule does not allow quasiquote itself to be used in an
   unquotation.  This, however, doesn't seem to be a big loss.

Actually, I do this all the time.  I found no fewer than 6 instances
in my scheme-to-common lisp translator.  The following is typical:

(define (generate-general-letrec node env cont)
  (let* ((vars (letrec-vars node))
	 (vals (letrec-vals node))
	 (new-names (cl-externalize-locals vars env))
	 (new-env (bind-variables vars new-names env)))
    `(ps-lisp:let ,(map (lambda (new-name)
		          `(,new-name ps:unassigned))
		        new-names)
       ,@(map (lambda (var val)
		`(ps-lisp:setq ,var ,(generate val new-env cont/value)))
	      new-names
	      vals)
       ,@(deprognify (generate (letrec-body node) new-env cont)))))

Jonathan