[ab] SDL:WITH-RECTANGLE

Anthony Fairchild fairchild.anthony at gmail.com
Sun Apr 15 12:01:20 CDT 2007


Hello again,

I am playing around with some of the convenience WITH-* macros and
discovered what I believe is a bug in WITH-RECTANGLE, and possibly other
WITH-* macros.  It appears that it only works when LISPBUILDER-SDL is "used"
in the current package, because it defines X Y W H in the LISPBUILDER-SDL
package.  I dont usually "use" packages into my working package, I like to
see where my dependencies are, make sense?   Here's what it macroexpands to:

JIGSAW-PUZZLE> (macroexpand-1 '(sdl:with-rectangle (r (sdl:rectangle :x 10
:y 10 :w 10 :h 10))
                                (util:print-vars x y w h)))
(LET* ((R (LISPBUILDER-SDL:RECTANGLE :X 10 :Y 10 :W 10 :H 10))
       (LISPBUILDER-SDL:*DEFAULT-RECTANGLE* R))
  (SYMBOL-MACROLET ((LISPBUILDER-SDL:X (LISPBUILDER-SDL:X R))
                    (LISPBUILDER-SDL:Y (LISPBUILDER-SDL:Y R))
                    (LISPBUILDER-SDL::W (LISPBUILDER-SDL:WIDTH R))
                    (LISPBUILDER-SDL::H (LISPBUILDER-SDL:HEIGHT R)))
    (COM.PUREVIRTUAL.UTIL:PRINT-VARS X Y W H)
    (IF T (LISPBUILDER-SDL:FREE-RECTANGLE R))))
T

I can get it to work if I do this:

(sdl:with-rectangle (r rect)
    (util:print-vars sdl::x sdl::y sdl::w sdl::h))

So is this a bug or am I being too nit-picky? ;-)

Thanks,

Anthony
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.lispniks.com/pipermail/application-builder/attachments/20070415/f2b3f3ce/attachment.html


More information about the application-builder mailing list