--=-=-=
Content-Transfer-Encoding: quoted-printable
Larry Clapp <[EMAIL PROTECTED]> writes:
> You're using Z incorrectly.
Agreed. It may be a good idea to translate problematic MACROLET forms
to DEFMACRO, which uses the same evaluation scheme but is amenable to
MACROEXPAND-1 and TRACE. (Some uses of MACROLET cannot be so
translated, in particular when the MACROLET form is generated by
another macro.)
* (lisp-implementation-version)
"CVS release-18e-branch + minimal debian patches"
* (defmacro fudge (z)
`(list 1 2 3 ,@z))
FUDGE
* (macroexpand-1 '(fudge x))
(LIST 1 2 3 . X)
T
* (trace fudge)
Error in function DEBUG::TRACE-1:
Can't use encapsulation to trace anonymous function #<Interpreted Functi=
on "DEFMACRO FUDGE"
{4802CBE1}>.
Restarts:
0: [ABORT] Return to Top-Level.
Debug (type H for help)
(DEBUG::TRACE-1 FUDGE #<Trace-Info NIL> NIL)
Source:=20
; File: target:code/ntrace.lisp
(ERROR "Can't use encapsulation to trace anonymous function ~S." FUN)
0] abort
* (compile 'fudge)
Error in function C::GET-LAMBDA-TO-COMPILE:
#<Closure Over Function "DEFUN (SETF MACRO-FUNCTION)"
{4802CF89}> was defined in a non-null environment.
Restarts:
0: [ABORT] Return to Top-Level.
Debug (type H for help)
(C::GET-LAMBDA-TO-COMPILE
#<Closure Over Function "DEFUN (SETF MACRO-FUNCTION)" {4802CF89}>)
Source:=20
; File: target:compiler/main.lisp
(ERROR "~S was defined in a non-null environment." DEFINITION)
0] abort
; Compilation unit aborted.
* (funcall (compile nil '(lambda () (defmacro fudge (z) `(list 1 2 3 ,@z)))=
))
; Converted FUDGE.
; Compiling LAMBDA NIL:=20
; Compiling Top-Level Form:=20
FUDGE
* (trace fudge)
(FUDGE)
* (macroexpand-1 '(fudge x))
0: ((:MACRO FUDGE) (FUDGE X) #<unused-arg>)
0: FUDGE returned (LIST 1 2 3 . X)
(LIST 1 2 3 . X)
T
* (defun foo (x)
(fudge x))
FOO
* (compile 'foo)
0: ((:MACRO FUDGE) (FUDGE X) #<unused-arg>)
0: FUDGE returned (LIST 1 2 3 . X)
Type-error in KERNEL::OBJECT-NOT-LIST-ERROR-HANDLER: X is not of type LIST
Restarts:
0: [ABORT] Return to Top-Level.
Debug (type H for help)
(C::IR1-CONVERT-COMBINATION-ARGS #<Continuation c1>
#<Continuation c2>
(1 2 3 . X))
Source:=20
; File: target:compiler/ir1tran.lisp
(DOLIST (ARG ARGS)
(LET (#)
(IR1-CONVERT THIS-START THIS-CONT ARG)
(SETQ THIS-START THIS-CONT)
(ARG-CONTS THIS-CONT)))
0]=20
--=-=-=
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
iD8DBQBDt8W6Hm9IGt60eMgRAkFBAKCGLtAZkBM4UVOg6NowlJsrIOhVsQCggf5d
3tPD5+B0to6tNyzDMIP0xxY=
=tWkz
-----END PGP SIGNATURE-----
--=-=-=--