[Prev][Next][Index][Thread]

Re: reading a float?



chris@double.co.nz (Chris Double) writes:

> Henry Baker's paper on the Meta parser[1] has a Common Lisp implementation 
> of read-number which does float conversion from streams/strings. Perhaps 
> this could be used for Dylan as well using David Lichteblau's Dylan 
> implementation of Meta[2] for a portable solution.

No, it doesn't.  Baker's function `parse-number' calls `make-float',
which is not shown, and this is the tricky part.  If we want float
reading and printing to work accurately then someone has to implement
the algorithms mentioned on gd-hackers.  (That wouldn't be hard; one of
the papers even has working Scheme sources.)

Unfortunately the C library doesn't have functions to decode and make
floats, so Gwydion Dylan doesn't have them either.  Someone who wants
float reading and printing would have to implement this functionality
first (and should look at CMU Common Lisp, which provides all this).

But adding these functions (to Gwydion Dylan) would introduce
architecture-dependant code.  What do the maintainers of gd think about
this issue?



Follow-Ups: References: