[plt-scheme] help with with-syntax

From: Jon Rafkind (workmin at ccs.neu.edu)
Date: Sat Sep 16 23:10:23 EDT 2006

Im probably missing something basic but why doesn't the following
replace the first argument to blah with 'boo? I sort of think it is but
then the printf never happens.

(define-syntax foo
  (syntax-rules ()
    ((_ x ...)
     (printf "You passed in ~a\n" (car (list 'x ...))))))

(define-syntax blah
  (syntax-rules ()
    ((_ first x ...)
     (with-syntax ((f1 (datum->syntax-object #'first 'boo #'first)))
       #'(foo f1 x ...)))))

#; (foo 1 2 3)
(blah q w e)


Posted on the users mailing list.