[Openmcl-devel] Scribble demo

Raffael Cavallaro raffaelcavallaro at mac.com
Thu Jun 4 11:12:01 PDT 2009


On Jun 4, 2009, at 1:49 PM, Neil Baylis wrote:

> Does putting the defun inside the let do something different than  
> putting the let inside the defun?

If the let is inside the defun you generate a new temporary  
NSBezierPath each time you call label. If you wrap the defun in the  
let, every call to label uses the same identical NSBezierPath to draw  
the label:

? (let ((a (list 1 2)))
     (defun foo () a))
FOO
? (foo)
(1 2)
? (eq (foo) (foo))
T
? (defun bar ()
     (let ((a (list 1 2)))
       a))
BAR
? (bar)
(1 2)
? (eq (bar) (bar))
NIL
?

warmest regards,

Ralph



Raffael Cavallaro
raffaelcavallaro at me.com








More information about the Openmcl-devel mailing list