Just for fun …

cocoa-listener.png

The McCLIM listener in a cocoa window, running on the latest Clozure CL beta.

It took some time, since on OS X 10.5 CGFloat can be either single-float or double-float, depending on the processor. At the moment, I just rewired the hardwired (coerce … ’single-float) calls and numeric constants in the beagle backend. Also, it crashes on the all-important “Show Class Subclasses t” benchmark. Still, very nice.

2 Responses to “Just for fun …”

  1. I ran into the same single-float/double-float issue with the Open Agent Engine (an Open GL and Animation library). After talking with Gary Byers about it, I ended up with the following function (which should probably be a macro but whatever):

    (defun PLATFORM-FLOAT (value)
    #+32-bit-target
    (ccl::float value)
    #+64-bit-target
    (ccl::%double-float value))

    Now I use (platform-float abc) to coerce to the right type for calling CoreGraphics, OpenGL, and other Mac OS calls.

  2. rudi says:

    I went with deftype and coerce instead, and would feel extremely uneasy committing ccl::anything anywhere outside CCL itself.

    Hmm, I should really clean up and commit the patch sometime.

Leave a Reply