macroexpansion (slime-expand-1) results in error

Mirko Vukovic mirko.vukovic at gmail.com
Thu Dec 10 20:02:43 UTC 2015


On Thu, Dec 10, 2015 at 1:32 PM, Luís Oliveira <luismbo at gmail.com> wrote:

> On Thu, Dec 10, 2015 at 4:16 PM, Mirko Vukovic <mirko.vukovic at gmail.com>
> wrote:
> > I played by selectively adding code -- I started with the
> (with-png-output
> > ...) just by itself, and that worked.
> > Then I started adding form by form.  It failed when I added the last form
> > (fill-and-stroke).
>
> Can you paste the complete backtrace? (You can get it by clicking
> --more-- after the last displayed frame in the debugger.)
>
>
More information.  Here is the form where the trouble is -- note the ><
signs in it which
I added now:

(define-test pie-wedge/literal
  >(with-png-output ("pie-wedge--literal.png" :width 80 :height 80)
    (let ((x 0) (y 0)
 (radius 70)
 (angle1 (* (/ pi 180) 15))
 (angle2 (* (/ pi 180) 45)))
      (translate 5 5)
      (set-rgb-fill 1 1 1)
      (move-to 0 0)
      (arc x y radius angle1 angle2)
      (fill-and-stroke)))<)

The error occurs when I expand with the cursor at the position marked with
<.  In other words
when the macro (with-png ...) is inside the (define-test ...) form.

If I cut that macro to be a top-level form (so that it is outside the
define-test), the it expands fine.

Here is the backtrace:

The value NIL is not of the expected type ARRAY.
   [Condition of type TYPE-ERROR]

Restarts:
 0: [*ABORT] Return to SLIME's top level.
 1: [ABORT-BREAK] Reset this thread
 2: [ABORT] Kill this thread

Backtrace:
  0: (CCL::ARRAY-DATA-AND-OFFSET NIL)
  1: (MAKE-STRING-INPUT-STREAM NIL 0 0)
  2: (READ-FROM-STRING NIL T NIL :START 0 :END NIL :PRESERVE-WHITESPACE NIL)
  3: ((:INTERNAL SWANK::FROM-STRING))
  4: (SWANK::CALL-WITH-BUFFER-SYNTAX NIL #<CCL:COMPILED-LEXICAL-CLOSURE
(:INTERNAL SWANK::FROM-STRING) #x2101BDE42F>)
  5: ((:INTERNAL SWANK::APPLY-MACRO-EXPANDER))
  6: (SWANK::CALL-WITH-BINDINGS ((*PRINT-CIRCLE*) (*PRINT-PRETTY* . T)
(*PRINT-ESCAPE* . T) (*PRINT-LINES*) (*PRINT-LEVEL*) (*PRINT-LENGTH*))
#<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL ..))
  7: (SWANK::CALL-WITH-BUFFER-SYNTAX NIL #<CCL:COMPILED-LEXICAL-CLOSURE
(:INTERNAL SWANK::APPLY-MACRO-EXPANDER) #x2101BDE5DF>)
  8: (CCL::CALL-CHECK-REGS SWANK:SWANK-EXPAND-1 NIL)
  9: (CCL::CHEAP-EVAL (SWANK:SWANK-EXPAND-1 NIL))
 10: (SWANK:EVAL-FOR-EMACS (SWANK:SWANK-EXPAND-1 NIL) "#:display-it" 65)
 11: ((:INTERNAL SWANK::SPAWN-WORKER-THREAD))
 12: (SWANK/BACKEND:CALL-WITH-DEBUGGER-HOOK #<Compiled-function
SWANK:SWANK-DEBUGGER-HOOK #x21012BB58F> #<Compiled-function (:INTERNAL
SWANK::SPAWN-WORKER-THREAD) (Non-Global)  #x210128363F>)
 13: (SWANK::CALL-WITH-BINDINGS ((*STANDARD-OUTPUT* .
#<SWANK/GRAY::SLIME-OUTPUT-STREAM #x2101491A2D>) (*STANDARD-INPUT* .
#<SWANK/GRAY::SLIME-INPUT-STREAM #x2101491D9D>) ..)))
#<CCL:COMPILED-LEXICAL-CLOSU..
 14: ((:INTERNAL SWANK::SPAWN-WORKER-THREAD))
 15: (CCL::RUN-PROCESS-INITIAL-FORM #<PROCESS worker(37) [Active]
#x2101BDA3ED> (#<CCL:COMPILED-LEXICAL-CLOSURE (:INTERNAL
CCL::%PROCESS-RUN-FUNCTION) #x2101BDA17F>))
 16: ((:INTERNAL (CCL::%PROCESS-PRESET-INTERNAL (CCL:PROCESS))) #<PROCESS
worker(37) [Active] #x2101BDA3ED> (#<CCL:COMPILED-LEXICAL-CLOSURE
(:INTERNAL CCL::%PROCESS-RUN-FUNCTION) #x2101BDA17F>))
 17: ((:INTERNAL CCL::THREAD-MAKE-STARTUP-FUNCTION))


> Cheers,
>
> --
> Luís Oliveira
> http://kerno.org/~luis/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/slime-devel/attachments/20151210/c43b01fd/attachment-0001.html>


More information about the slime-devel mailing list