[ansi-test-devel] Local function binding shadows global macro

Sam Steingold sds at gnu.org
Fri Aug 26 16:05:23 UTC 2011


Hi Eric,

I think what you want is:

(defmacro test-macro (argument) (error "Bad macro called(~S)" argument))
(defun test-function ()
  (flet ((test-macro (argument) (list 'good argument)))
    (test-macro 1)))
(test-function) 
==> (GOOD 1)
(macrolet ((test-macro (argument) `'(good ,argument)))
  (test-macro 1))
==> (GOOD 1)

-- 
Sam Steingold (http://sds.podval.org/) on CentOS release 5.6 (Final) X 11.0.60900031
http://pmw.org.il http://mideasttruth.com http://www.memritv.org
http://camera.org http://www.PetitionOnline.com/tap12009/
Save the whales, feed the hungry, free the mallocs.





More information about the ansi-test-devel mailing list