[Ecls-list] Macros impossible in compiled function

Peter Enerccio enerccio at gmail.com
Mon Dec 10 22:28:08 UTC 2012


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20121210/fc81347f/attachment.html>


More information about the ecl-devel mailing list