15 Mar
2015
15 Mar
'15
6:16 a.m.
G'day, CMUCL does not shadow the compiler macro function present in the global environment when introducing a function with the same name in the current lexical environment. This is demonstrated with the following example: (defun square (x) (expt x 2)) (define-compiler-macro square (&whole form arg) (declare (ignore arg)) form) (defun test () (flet ((square (arg) (declare (ignore arg)) (write "SQUARE!"))) (macrolet ((my-square (arg &environment env) (if (compiler-macro-function 'square env) `(function square) nil))) (my-square 1)))) (test) => #<Function (FLET SQUARE TEST) {48704B89}> Thanks Mark