From jm at symbolic-simulation.com Mon May 3 19:25:14 2021 From: jm at symbolic-simulation.com (John Morrison) Date: Mon, 3 May 2021 15:25:14 -0400 Subject: scigraph suffering from bitrot? Message-ID: Hi; Before I strap on my hip-waders, is my intuition that climi::pixmap type has been refactored correct? Please advise If so, that's where I'll start looking - and if you suggest a backend-independent type I should be using, I will be most grateful. I also checked scigraph-evo, and its demos fail in precisely the same way as bundled Apps/Scigraph's demos. Thanks in advance for pointing the way, -jm p.s., I was looking for a real pan-and-zoom XY canvas - if anybody has better suggestions, I'm all ears. -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel at turtleware.eu Thu May 13 15:42:28 2021 From: daniel at turtleware.eu (=?utf-8?Q?Daniel_Kochma=C5=84ski?=) Date: Thu, 13 May 2021 15:42:28 +0000 Subject: define-presentation-to-command-translator In-Reply-To: <50b05911-2f84-1e52-4ae2-bfc1e60205d6@snoopy.qozzy.com> References: <50b05911-2f84-1e52-4ae2-bfc1e60205d6@snoopy.qozzy.com> Message-ID: Hey Paul, thank you for the report! After looking into this I've concluded that your example is incorrect. >From http://bauhh.dyndns.org:8000/clim-spec/23-7.html#_1233 (define-presentation-to-command-translator specification): > The other arguments to define-presentation-to-command-translator are the same as for define-presentation-translator. [applies also to to arglist] Then http://bauhh.dyndns.org:8000/clim-spec/23-7.html#_1230 (define-presentation-translator specification) > arglist, tester-arglist, and doc-arglist are each an argument list that must "match" the following "canonical" argument list. > (object &key presentation context-type frame event window x y) > In order to "match" the canonical argument list, there must be a single positional argument that corresponds to the presentation's object, and several named arguments that must match the canonical names above (using string-equal to do the comparison) In your example you have: (define-presentation-to-command-translator xlate-set-rcursor (clim:blank-area com-set-cursor foo) (x y window) (%set-a-cursor *standard-output* x y window)) So the arglist is (x y window). X is matched as the positional required argument OBJECT, then Y and WINDOW are matched by name (as if we had transformed this arglist to (object &key y window). Perhaps LW CLIM doesn't uphold this requirement and matches all arguments by name? Best regards, Daniel -- Daniel Kochmański ;; aka jackdaniel | Przemyśl, Poland TurtleWare - Daniel Kochmański      | www.turtleware.eu "Be the change that you wish to see in the world." - Mahatma Gandhi From daniel at turtleware.eu Thu May 13 15:43:15 2021 From: daniel at turtleware.eu (=?utf-8?Q?Daniel_Kochma=C5=84ski?=) Date: Thu, 13 May 2021 15:43:15 +0000 Subject: make-translator-fun In-Reply-To: References: <7b4dcb51-c80e-2021-fb3b-dc0a18e6e951@snoopy.qozzy.com> Message-ID: Ah, sorry, this was already answered! I'm cleaning my inbox and missed this email. -- Daniel Kochmański ;; aka jackdaniel | Przemyśl, Poland TurtleWare - Daniel Kochmański | www.turtleware.eu "Be the change that you wish to see in the world." - Mahatma Gandhi ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Sunday, January 10, 2021 4:13 PM, Paul Werkowski wrote: > The context for my post was this: > > (define-presentation-to-command-translator xlate-set-lcursor > (clim:blank-area com-set-cursor plotter > :documentation "Set Left Cursor" > :gesture :select > :tester ((object window) > (declare (ignore object)) > (typep window 'basic-chart-pane))) > (object x y window) > (%set-a-cursor (chart-pane-chart window) 'lcursor x y window)) > > where originally I omitted 'object' from the next to last line resulting in the wrong values being presented to the %set-a-cursor function. User error on my part but LispWorks CLIM2 did what I expected anyway thus keeping me ignorant of my omission. Perhaps LW was able to infer what I wanted. > > On 1/10/2021 2:45 AM, Lauren P wrote: > >> Hey, >> >> On Sat, Jan 9, 2021, 11:21 Paul Werkowski wrote: >> >>> (defun make-translator-fun (args body) >>> (cond ((null args) >>> (warn "OBJECT parameter is obligatory (adding ignored parameter)") >>> (let ((object-arg (gensym "OBJECT-ARG"))) >>> `(lambda (,object-arg &key &allow-other-keys) >>> (declare (ignore ,object-arg)) >>> , at body))) >>> (t >>> `(lambda (,(car args) &key ,@(cdr args) &allow-other-keys) >>> (declare (ignorable ,(car args))) >>> , at body)))) >>> >>> I guess the above does the right thing if ARGS is NIL but won't catch >>> the case of ARGS incorrectly given as, for instance, (x y window) >>> instead of (object x y window). >> >> I would give it an explicit parameter so it takes (OBJECT-ARG ARGS BODY) so autodoc shows where the object argument goes without having to remember to read the docstring. >> >> I'd put in a destructuring bind at the T case and then test that... it should bomb in the compiler if you pass it (NIL X Y WINDOW) as-is: you'll need to gensym and DECLARE IGNORE if it's a NIL. >> >> If you wrap it in a macro the way I write that lambda list is ((OBJECT-ARG &REST ARGS) &BODY BODY); it is displayed by autodoc and the destructuring bind catches it at compile time. If you really want to accept a no arguments form, I tend to use NAME* for the alternative form and make it a wrapper stub, otherwise I prefer to assume "forgot arguments" and error. >> >> I wouldn't set the object argument ignorable in the T case unless it was typed in as NIL, as it can hide bugs in the body code. Better to let the user specify ignorable in the BODY if they are sure they don't need it. >> >> (More of a style thing, I find it cleaner to normalize the argument list to replace the empty list with (NIL) so it works with destructuring bind: you can get rid of the main branch and only type the bulk of the code once, since you need to check for a gensym and ignore declaration in the T case as well. Also, leave out &ALLOW-OTHER-KEYS unless absolutely necessary... I've found it makes it exceedingly difficult to catch typos.) >> >> Hope this is useful for you! >> >>> -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel at turtleware.eu Sun May 23 14:18:25 2021 From: daniel at turtleware.eu (=?utf-8?Q?Daniel_Kochma=C5=84ski?=) Date: Sun, 23 May 2021 14:18:25 +0000 Subject: [new irc server] Message-ID: <61VazVJXH-QYKkj9DSkmSVuB32B4kL8CrQWgqewHGMN8trijWm_o1xbg0sd1dgnFfpYhg6uLwN49ByLPQTQmaLVZn_n-2_cBvtkMJex1MoU=@turtleware.eu> Hey, Due to the recent events revolving freenode IRC network I've moved the IRC channelto #clim @ libera.chat. The old channel is obsolete. Best regards, Daniel -- Daniel Kochmański ;; aka jackdaniel | Przemyśl, Poland TurtleWare - Daniel Kochmański      | www.turtleware.eu "Be the change that you wish to see in the world." - Mahatma Gandhi