[gambit-list] Quasiquote syntax question.

Taylor R Campbell campbell at mumble.net
Fri Feb 1 16:17:20 EST 2008


   Date: Fri, 01 Feb 2008 16:07:42 -0500
   From: Blake Winton <bwinton at latte.ca>

   (I'ld even live with ($ a b c), but I can't seem to get that working either.)

Try

(define-syntax $
  (syntax-rules ()
    (($ x) (quasiquote x)))),

or

(define-macro ($ x)
  (list 'quasiquote x)).

(This is subtly different from what I am guessing you asked for, but
more general: I am guessing that by ($ a b c) you meant `(a b c), but
in that case you have no way to write `a for something that is not a
list (e.g., a vector).  This may not matter to you -- modifying the
above macros to do that is left as a trivial exercise for the reader.)

Alteration of the $ character in the readtable is generally a bad
idea, because there may be many legitimate symbols that begin with it,
which you would be left with no way to name.

Alternatively, is there really no way for you to enter a backtick, or
to translate the $ key stroke to a ` character?  If you used $, your
code would be very confusing for anyone who tried to read it.



More information about the Gambit-list mailing list