This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Macro expansion problem


The following test program prints
Trace1: (symbol->string (quote b))
upon loading.  define-input is not passed into the function,
test-exprs->proc, but is matched anyway.

;;; x.scm -- display macro expansion problem

(define-syntax mtrace1
       (syntax-rules ()
         ((mtrace1 x)
          (begin 
           (display "Trace1: ") (write 'x) (newline)
           x))))

(define (test-exprs->proc exprs)
  (cons
    'lambda
    `(()

      (define-syntax define-input
	    (syntax-rules ()
	      ((define-input var)
	       (define var 1))
	      ))

      (define-syntax
	  test-out
	    (syntax-rules (test-content-type!
			   define-input)
	      ((test-out (test-content-type! expr ...))
	       (test-content-type! expr ...))
	      ((test-out (define-input form))
	       (mtrace1 (define-input form)))
	      ((test-out expr) (display expr ))
	      ))
	(test-out ,@exprs))))

(define (test-make-nal l)
  (eval (test-exprs->proc l)))

(define (test-content-type! c type)
  (set-car! (cdddr (cddddr c)) type))

((test-make-nal '((symbol->string (quote b)))))

Dan Stanger
Eaton Vance Management
Two International Place 
Boston, MA 02110
Mobile: 617 646 9682
Office: 617 672 8261


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]