[ltk-user] Problems with double floats
Thomas F. Burdick
tfb at ocf.berkeley.edu
Sun Aug 12 07:58:29 UTC 2007
On 8/11/07, Tobias C. Rittweiler <tcr at freebits.de> wrote:
>
> Hi,
>
> maybe I'm missing something obvious, but LTK doesn't seem to work with
> double-floats for me. For instance:
> (with-ltk ()
> (let ((c (make-canvas nil)))
> (pack c)
> (create-line c '(0 0 100 100d0))))
You're not missing anything; at the moment Ltk is sending the PRINC
representation of your numbers to Tk, which means Tk gets something
like 100.0d0, which it doesn't understand. This should be fixed in
the Ltk release after next.
In the meantime, there are two work-arounds: either use single floats
or set *read-default-float-format* to double-float. I don't see the
point in using double-floats to represent on-screen values, but maybe
they're the results of calculations where double-floats are warranted,
in which case the second alternative might be easier than coercing to
single-floats.
>
> In the first case, a window pops up with the line drawn as desired. But
> in the second case, an /empty/ window pops up. Further, when trying to
> to close the window, the window exits on one hand, but the Slime REPL
> doesn't get back. (I have to interrupt via `C-c C-c', and then type `q'
> to get out of SLDB.)
>
> Huh? :-),
>
> -T.
>
> _______________________________________________
> ltk-user site list
> ltk-user at common-lisp.net
> http://common-lisp.net/mailman/listinfo/ltk-user
>
More information about the ltk-user
mailing list