From j.k.cunningham at comcast.net Mon Nov 9 03:58:16 2009 From: j.k.cunningham at comcast.net (Jeff Cunningham) Date: Sun, 08 Nov 2009 19:58:16 -0800 Subject: [cl-gd-devel] proposed patch for WITH-TRANSFORMATION macro Message-ID: <4AF79358.2050301@comcast.net> Hi, I use cl-gd extensively and decided to figure out how to eliminate the incessant SBCL generated warnings that trace back to the WITH-TRANSFORMATION macro. It looks like work has already been done there. I came up with a pretty clean solution which removes the existing argument checking, provides it through a different mechanism and satisfies SBCL and backwards compatibility. I don't have any other platforms to test with but I think it will run on anything. I've attached the patch. Regards, Jeff Cunningham -------------- next part -------------- A non-text attachment was scrubbed... Name: transform.lisp.patch Type: text/x-patch Size: 10807 bytes Desc: not available URL: From j.k.cunningham at comcast.net Mon Nov 9 05:47:56 2009 From: j.k.cunningham at comcast.net (Jeff Cunningham) Date: Sun, 08 Nov 2009 21:47:56 -0800 Subject: [cl-gd-devel] proposed patch for WITH-TRANSFORMATION macro In-Reply-To: <4AF79358.2050301@comcast.net> References: <4AF79358.2050301@comcast.net> Message-ID: <4AF7AD0C.1000606@comcast.net> Here's the same patch with the added -b flag to ignore whitespace (sorry about that). --Jeff Jeff Cunningham wrote: > Hi, > > I use cl-gd extensively and decided to figure out how to eliminate the > incessant SBCL generated warnings that trace back to the > WITH-TRANSFORMATION macro. It looks like work has already been done > there. I came up with a pretty clean solution which removes the > existing argument checking, provides it through a different mechanism > and satisfies SBCL and backwards compatibility. I don't have any other > platforms to test with but I think it will run on anything. I've > attached the patch. > > Regards, > Jeff Cunningham > > > ------------------------------------------------------------------------ > > _______________________________________________ > cl-gd-devel site list > cl-gd-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/cl-gd-devel -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: transform.lisp.patch Type: text/x-patch Size: 3339 bytes Desc: not available URL: From hans.huebner at gmail.com Mon Nov 9 12:07:30 2009 From: hans.huebner at gmail.com (=?ISO-8859-1?Q?Hans_H=FCbner?=) Date: Mon, 9 Nov 2009 13:07:30 +0100 Subject: [cl-gd-devel] proposed patch for WITH-TRANSFORMATION macro In-Reply-To: <4AF7AD0C.1000606@comcast.net> References: <4AF79358.2050301@comcast.net> <4AF7AD0C.1000606@comcast.net> Message-ID: Jeff, I have not actually tested your patch, but before I do, can you please re-send it without the debugging format statements that you've left in? Thanks, Hans On Mon, Nov 9, 2009 at 06:47, Jeff Cunningham wrote: > Here's the same patch with the added -b flag to ignore whitespace (sorry > about that). > > --Jeff > > > > Jeff Cunningham wrote: > > Hi, > > I use cl-gd extensively and decided to figure out how to eliminate the > incessant SBCL generated warnings that trace back to the WITH-TRANSFORMATION > macro. It looks like work has already been done there. I came up with a > pretty clean solution which removes the existing argument checking, provides > it through a different mechanism and satisfies SBCL and backwards > compatibility. I don't have any other platforms to test with but I think it > will run on anything. I've attached the patch. > > Regards, > Jeff Cunningham > > > ________________________________ > _______________________________________________ > cl-gd-devel site list > cl-gd-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/cl-gd-devel > > _______________________________________________ > cl-gd-devel site list > cl-gd-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/cl-gd-devel > From j.k.cunningham at comcast.net Mon Nov 9 17:41:25 2009 From: j.k.cunningham at comcast.net (Jeff Cunningham) Date: Mon, 09 Nov 2009 09:41:25 -0800 Subject: [cl-gd-devel] proposed patch for WITH-TRANSFORMATION macro In-Reply-To: <4AF79358.2050301@comcast.net> References: <4AF79358.2050301@comcast.net> Message-ID: <4AF85445.5080400@comcast.net> Here are the complaints I was getting which are eliminated: warning: Asserted type NUMBER conflicts with derived type (VALUES NULL &OPTIONAL). --> LET LET UNLESS IF PROGN SETQ THE ==> (- #:X214 #:WIDTH15) warning: Asserted type NUMBER conflicts with derived type (VALUES NULL &OPTIONAL). --> LET LET UNLESS IF PROGN SETQ THE ==> (- #:Y217 #:HEIGHT18) warning: Asserted type NUMBER conflicts with derived type (VALUES NULL &OPTIONAL). --> LET LET UNLESS IF PROGN SETQ THE ==> (+ #:Y116 #:HEIGHT18) warning: Asserted type NUMBER conflicts with derived type (VALUES NULL &OPTIONAL). --> LET LET UNLESS IF PROGN SETQ THE ==> (+ #:X113 #:WIDTH15) --Jeff From edi at agharta.de Sun Nov 15 11:53:07 2009 From: edi at agharta.de (Edi Weitz) Date: Sun, 15 Nov 2009 12:53:07 +0100 Subject: [cl-gd-devel] cl-gd patch In-Reply-To: <4AFF7845.9060109@comcast.net> References: <4AFF7845.9060109@comcast.net> Message-ID: Hi, That nobody seems to have looked at it is probably a bit exaggerated as at least Hans and I looked at it, and Hans also asked for a revision (and I agree with this request) to which you haven't replied yet. FWIW, here are the patch guidelines again: http://weitz.de/patches.html Thanks, Edi. On Sun, Nov 15, 2009 at 4:40 AM, Jeff Cunningham wrote: > Dear Dr Weitz; > > I posted a patch to the cl-gd project through the ?mailing list about a week > ago which no one seems to have looked at. I believe it solves a minor > irritation with SBCL users (warnings go away), is backwards compatible and > disturbs nothing else. I was hoping you would adopt it. I know you are very > busy and probably since this list is so inactive seldom look at it anymore. > But I use this library all the time and am planning to release a scientific > plotting library built on top of it very shortly, so I'd like to have all > the interfaces working as cleanly as possible. > > Best regards, > Jeff Cunningham > > From j.k.cunningham at comcast.net Sun Nov 15 17:12:06 2009 From: j.k.cunningham at comcast.net (Jeff Cunningham) Date: Sun, 15 Nov 2009 09:12:06 -0800 Subject: [cl-gd-devel] cl-gd patch In-Reply-To: References: <4AFF7845.9060109@comcast.net> Message-ID: <4B003666.2000709@comcast.net> Edi Weitz wrote: > Hi, > > That nobody seems to have looked at it is probably a bit exaggerated > as at least Hans and I looked at it, and Hans also asked for a > revision (and I agree with this request) to which you haven't replied > yet. > > FWIW, here are the patch guidelines again: > > http://weitz.de/patches.html > > Thanks, > Edi. > > > It wasn't exaggerated from my perspective - the most recent activity on the list was May and I never saw Hans' post! I don't understand why, but that email from the list never showed up in my inbox (I even went back and checked through my spam). I checked the on-line November web-archives several times during the week and didn't see any activity there beyond mine and assumed this was a low priority. But now I see that Hans posted his reply the day after I posted to the list, but that posting didn't make it into the archives until just the last day or so (I checked most recently I think day before yesterday and it wasn't there). And yet, it says it was posted Nov 9th. Have there been other problems with the list server reported? In any event, now that I've seen Hans' request, I slapped my forehead for not seeing the debug statements, removed them, and here's the remade patch. Regards, Jeff Cunningham --- cl-gd-0.5.6/transform.lisp 2007-07-29 09:37:13.000000000 -0700 +++ source/cl-gd-0.5.6/transform.lisp 2009-11-15 08:24:03.000000000 -0800 @@ -72,7 +72,10 @@ "Like ROUND but make sure result isn't longer than 32 bits." (mod (round x) +most-positive-unsigned-byte-32+)) -(defmacro with-transformation ((&key x1 x2 width y1 y2 height reverse-x reverse-y (radians t) (image '*default-image*)) &body body) +(defmacro with-transformation ((&key (x1 0 x1set) (x2 0 x2set) (width 0 wset) + (y1 0 y1set) (y2 0 y2set) (height 0 hset) + reverse-x reverse-y (radians t) (image '*default-image*)) + &body body) "Executes BODY such that all points and width/height data are subject to a simple affine transformation defined by the keyword parameters. The new x-axis of IMAGE will start at X1 and end at X2 and @@ -93,23 +96,18 @@ angle-transformer) ;; rebind for thread safety `(let ((*transformers* *transformers*)) - (unless (<= 2 (count-if #'identity (list ,x1 ,x2 ,width))) - (error "You must provide at least two of X1, X2, and WIDTH.")) - (unless (<= 2 (count-if #'identity (list ,y1 ,y2 ,height))) - (error "You must provide at least two of Y1, Y2, and HEIGHT.")) - (when (and ,x1 ,x2 ,width - (/= ,width (- ,x2 ,x1))) - (error "X1, X2, and WIDTH don't match. Try to provide just two of the three arguments.")) - (when (and ,y1 ,y2 ,height - (/= ,height (- ,y2 ,y1))) - (error "Y1, Y2, and HEIGHT don't match. Try to provide just two of the three arguments.")) - ;; kludgy code to keep SBCL quiet - (unless ,x1 (setq ,x1 (- ,x2 ,width))) - (unless ,x2 (setq ,x2 (+ ,x1 ,width))) - (unless ,width (setq ,width (- ,x2 ,x1))) - (unless ,y1 (setq ,y1 (- ,y2 ,height))) - (unless ,y2 (setq ,y2 (+ ,y1 ,height))) - (unless ,height (setq ,height (- ,y2 ,y1))) + (macrolet ((checkargs (a1 a1set a2 a2set aspan aspanset c lbl) + `(progn + (cond ((and ,a1set ,a2set) (setq ,aspan (- ,a2 ,a1))) + ((and ,a1set ,aspanset) (setq ,a2 (+ ,a1 ,aspan))) + ((and ,a2set ,aspanset) (setq ,a1 (- ,a2 ,aspan))) + (t (error "Require two of ~c1, ~:*~c2, or ~a to be set." ,c ,lbl))) + (unless (> ,aspan 0) + (error "Require ~c1 < ~:*~c2" ,c)) + (unless (< (abs (/ (- ,a2 (+ ,a1 ,aspan)) ,aspan)) 1.e-5) + (error "~c1, ~:*~c2, and ~a don't match. Try to provide just two of the three arguments." ,c ,lbl))))) + (checkargs ,x1 ,x1set ,x2 ,x2set ,width ,wset #\x "width") + (checkargs ,y1 ,y1set ,y2 ,y2set ,height ,hset #\y "height")) (multiple-value-bind (,image-width ,image-height) (without-transformations (image-size ,image)) From edi at agharta.de Mon Nov 16 15:20:26 2009 From: edi at agharta.de (Edi Weitz) Date: Mon, 16 Nov 2009 16:20:26 +0100 Subject: [cl-gd-devel] cl-gd patch In-Reply-To: <4B003666.2000709@comcast.net> References: <4AFF7845.9060109@comcast.net> <4B003666.2000709@comcast.net> Message-ID: 2009/11/15 Jeff Cunningham : > It wasn't exaggerated from my perspective - the most recent activity on the > list was May and I never saw Hans' post! I don't understand why, but that > email from the list never showed up in my inbox (I even went back and > checked through my spam). I checked the on-line November web-archives > several times during the week and didn't see any activity there beyond mine > and assumed this was a low priority. But now I see that Hans posted his > reply the day after I posted to the list, but that posting didn't make it > into the archives until just the last day or so (I checked most recently I > think day before yesterday and it wasn't there). And yet, it says it was > posted Nov 9th. Have there been other problems with the list server > reported? Not that I'm aware of. I saw Hans' reply the same day you sent your initial email. > In any event, now that I've seen Hans' request, I slapped my forehead for > not seeing the debug statements, removed them, and here's the remade patch. Thanks. I'll be out of town for a week beginning tomorrow and I'll have to do some last-minute preparations today. I'll make a new CL-GD release next week. Edi. From edi at agharta.de Mon Nov 23 20:05:15 2009 From: edi at agharta.de (Edi Weitz) Date: Mon, 23 Nov 2009 21:05:15 +0100 Subject: [cl-gd-devel] New release 0.5.7 (Was: cl-gd patch) Message-ID: 2009/11/15 Jeff Cunningham : > In any event, now that I've seen Hans' request, I slapped my forehead for > not seeing the debug statements, removed them, and here's the remade patch. I've now uploaded release 0.5.7 which contains your patch. Thanks, Edi.