[gambit-list] Possible bug in define-macro

Bradley Lucier lucier at math.purdue.edu
Sat Apr 9 16:03:10 EDT 2011


You need to quote the "equal", otherwise you're trying to insert a
procedure into the code, not a symbol:

(define-macro (pushnew item lst . test)
  (let ((== (gensym)))
    `(let ((,==  ,(if (null? test)
		      'equal?
		      (car test))))
       (if (not (member ,item ,lst ,==))
	   (set! ,lst (cons ,item ,lst))))))

Brad




More information about the Gambit-list mailing list