Menu

#21 Unreachable code in x-set-draw-function-alist

demos
closed-fixed
None
2
2013-06-25
2013-06-25
No

In this function definition we have a COND whose first test is:
(cond ((or t (zerop *white*))
which as far as I can tell means that this branch should just happen and all the other branches should be cut.

It looks like this just came in in your [r8], Fred...

Related

Bugs: #21
Commit: [r8]

Discussion

  • Fred Gilham

    Fred Gilham - 2013-06-25

    At Tue, 25 Jun 2013 18:27:15 +0000,
    Robert P. Goldman wrote:

    [bugs:#21] Unreachable code in x-set-draw-function-alist

    Status: open
    Created: Tue Jun 25, 2013 06:27 PM UTC by Robert P. Goldman
    Last Updated: Tue Jun 25, 2013 06:27 PM UTC
    Owner: Fred Gilham

    In this function definition we have a COND whose first test is:
    (cond ((or t (zerop white))
    which as far as I can tell means that this branch should just happen and all the other branches
    should be cut.

    It looks like this just came in in your [r8], Fred...


    Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/garnetlisp/
    bugs/21/

    To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

    Oops. Testing code.

    I'll look at it. Thanks.

    "If you aren't making mistakes, you aren't working!"

    BTW, while fixing the demo-manyobjs demo I added a new Move2 function that simulates repeatedly
    clicking the gray box in the upper left corner. Then I ran it as a speed test under all the lisps
    I have available.

    Fastest: CMUCL 32 bit.
    Then CCL 64 bit, ACL 64 bit, and finally SBCL 64 bit.

    A bit unexpected.

    Here's the code if you're interested:

    (defun Move2 (N)
    (time
    (dotimes (i n)
    (when (zerop (mod i 100)) (format t "~d..." i) (force-output))
    (let ((selected (g-value GloSwitch :selected)))
    ;; Simulate clicking on the rectangle.
    (s-value GloSwitch :selected (if selected nil t))
    (opal:update win)))))

    BTW I love the clever way the original code makes clicking the rectangle have an effect:

    ((:outline ,ObjType
    (:box ,(o-formula
    (progn
    (gv GloSwitch :selected) ;just set up
    ; a dependency
    (list
    (random
    (- (the integer (g-value Win :width)) 50)) ;left
    (random
    (- (the integer (g-value Win :height)) 50)) ;top
    50 50))))

    Just depends on the state of the GloSwitch button, without ever using any value or anything. This
    is the kind of thing I always liked about Garnet.

    --
    Fred Gilham pastorfred@sunbot.homedns.org
    All flesh is like grass, and all its glory like the flower of grass.
    The grass withers, and the flower falls, but the word of the Lord remains forever.
    And this word is the Good News that was preached to you.

     

    Related

    Bugs: #21
    Commit: [r8]

  • Fred Gilham

    Fred Gilham - 2013-06-25
    • status: open --> closed-fixed
     
  • Fred Gilham

    Fred Gilham - 2013-06-25

    Committed a fix.