<div dir="ltr">As requested (and should have been provided in the original email)<br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 10, 2015 at 11:04 AM, Luís Oliveira <span dir="ltr"><<a href="mailto:luismbo@gmail.com" target="_blank">luismbo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">On Thu, Dec 10, 2015 at 3:56 PM, Mirko Vukovic <<a href="mailto:mirko.vukovic@gmail.com">mirko.vukovic@gmail.com</a>> wrote:<br>
> C-c Ret returns an error on some macros (but not on others):<br></span></blockquote><div><br></div><div>An example using the Vecto package:</div><div><br></div><div><div>(defmacro with-png-output ((stream/filename/pathname</div><div><span class="" style="white-space:pre"> </span> &key width height) &body body)</div><div> "Define canvas and emit picture generated by BODY"</div><div> `(with-canvas (:width ,width :height ,height)</div><div> ,@body</div><div> (save-png ,stream/filename/pathname)))</div></div><div><br></div><div>And example code:</div><div><div>(with-png-output ("pie-wedge--literal.png" :width 80 :height 80)</div><div> (let ((x 0) (y 0)</div><div><span class="" style="white-space:pre"> </span> (radius 70)</div><div><span class="" style="white-space:pre"> </span> (angle1 (* (/ pi 180) 15))</div><div><span class="" style="white-space:pre"> </span> (angle2 (* (/ pi 180) 45)))</div><div><span class="" style="white-space:pre"> </span>(translate 5 5)</div><div><span class="" style="white-space:pre"> </span>(set-rgb-fill 1 1 1)</div><div><span class="" style="white-space:pre"> </span>(move-to 0 0)</div><div><span class="" style="white-space:pre"> </span>(arc x y radius angle1 angle2)</div><div><span class="" style="white-space:pre"> </span>(fill-and-stroke))) ;;; **********************************</div></div><div><br></div><div>I played by selectively adding code -- I started with the (with-png-output ...) just by itself, and that worked.</div><div><div>Then I started adding form by form. It failed when I added the last form (fill-and-stroke).</div><div><br></div></div><div>Note: To add or remove code, I would add parenthesis to close the macro. Commenting out (via ;; or #+skip) would invariably</div><div>result in an error.</div><div><br></div><div>Doing it at the REPL via MACROEXPAND works fine:<br></div><div>(LET ((VECTO::*GRAPHICS-STATE* (MAKE-INSTANCE 'VECTO::GRAPHICS-STATE))) (VECTO::STATE-IMAGE VECTO::*GRAPHICS-STATE* 80 80) (UNWIND-PROTECT (PROGN (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)) (SAVE-PNG "pie-wedge--literal.png")) (VECTO::CLEAR-STATE VECTO::*GRAPHICS-STATE*)))<br></div><div><br></div><div><br></div><div>Mirko</div></div></div></div>