[Openmcl-devel] Scribble demo

Neil Baylis neil.baylis at gmail.com
Thu Jun 4 10:49:08 PDT 2009


Maybe this is just a stylistic thing, or maybe something else I don't
understand. In the scribble demo, there's a function "label' that just draws
the label box inside the window.
Why is it defined like this:

(let* ((path (make-instance ns:ns-bezier-path)))
  (#/moveToPoint: path (ns:make-ns-point 10 10))
  (#/lineToPoint: path (ns:make-ns-point 10 40))
  (#/lineToPoint: path (ns:make-ns-point 90 40))
  (#/lineToPoint: path (ns:make-ns-point 90 10))
  (#/lineToPoint: path (ns:make-ns-point 10 10))
  (defun label (v)
    (#/drawAtPoint:withAttributes: #@"Scribble" (ns:make-ns-point 15 15)
+null-ptr+)
    (#/stroke path)))


Instead of like this:

(defun label (v)
  (let* ((path (make-instance ns:ns-bezier-path)))
    (#/moveToPoint: path (ns:make-ns-point 10 10))
    (#/lineToPoint: path (ns:make-ns-point 10 40))
    (#/lineToPoint: path (ns:make-ns-point 90 40))
    (#/lineToPoint: path (ns:make-ns-point 90 10))
    (#/lineToPoint: path (ns:make-ns-point 10 10))
    (#/fill path)
    (#/drawAtPoint:withAttributes: #@"Scribble" (ns:make-ns-point 15 15)
+null-ptr+)
    (#/stroke path)))


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

Neil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20090604/d40dd39e/attachment.htm>


More information about the Openmcl-devel mailing list