[Ecls-list] Macros impossible in compiled function

Juan Jose Garcia-Ripoll juanjose.garciaripoll at gmail.com
Mon Dec 10 23:35:04 UTC 2012


Your code is incorrect. The defmacro is not a toplevel form and thus the
definition is not available for the statement that follows it. Use macrolet
instead.
El 10/12/2012 23:28, "Peter Enerccio" <enerccio at gmail.com> escribió:

> Hello, I dont know if this is related to the common lisp or the ecl,
> but imagine code like this, compiled into function:
>
> (LAMBDA ()
>   (LET ((CORE::P *PACKAGE*) (CORE:THIS #<a GAME:CUBE>))
>     (IN-PACKAGE ANCA)
>     (HANDLER-CASE
>      (UNWIND-PROTECT
>          (PROGN
>           (PROGN
>            (DEFMACRO ANCA::RUNNABLE (&BODY ANCA::BODY)
>              (SI:QUASIQUOTE (LAMBDA () (SI:UNQUOTE-SPLICE ANCA::BODY))))
>            ((ANCA::RUNNABLE (PRINT "Ahoj")))))
>        (SETF *PACKAGE* CORE::P))
>      (T (CORE::X)
>       (FUNCALL
>        #<bytecompiled-closure #<bytecompiled-function 00000000032387d0>>
>        #<a GAME:CUBE>
>        CORE::X)))
>     T))
>
> which will work fine, until it will be run, where it will crash with
>
> ;;; Loading #P"/usr/lib/ecl-12.12.1/cmp.fas"
> ;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=0
> ;;;
> ;;; Error:
> ;;;   * (ANCA::RUNNABLE (PRINT "Ahoj")) is not a legal function name.The
> variable C::GAZONK is unbound.
>
> I have no idea what C::GAZONK is, but I imagine that it is not recognizing
> macro made with the defmacro before?
>
> The problem is, that I need to save this into lambda so it is evaluated
> later, not right now (and definitely not in this thread).
>
> --
> Bc. Peter Vaňušanik
> http://www.bishojo.tk
>
>
>
> ------------------------------------------------------------------------------
> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
> Remotely access PCs and mobile devices and provide instant support
> Improve your efficiency, and focus on delivering more value-add services
> Discover what IT Professionals Know. Rescue delivers
> http://p.sf.net/sfu/logmein_12329d2d
> _______________________________________________
> Ecls-list mailing list
> Ecls-list at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ecls-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20121211/eba016a0/attachment.html>


More information about the ecl-devel mailing list