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

Re: reading a float?



brucehoult@pobox.com (Bruce Hoult) wrote in <brucehoult-
1904001604070001@bruce.bgh>:
>
>Now, where to put it?
>
>d2c/runtime.dylan/num.dylan ?
>d2c/runtime.dylan/string.dylan ?
>common/string-ext/conversions.dylan ?
>common/common-dylan/common-extensions.dylan ?

common-extensions is where string-to-integer lives so my vote would be for 
it to be there. There's no common lisp equivalent for converting to floats 
as well so perhaps Dylan inherited its abscence from that. Although with CL 
you can use the various reader functions to implement it. 

Anyone got an implementation for Functional Developer? 

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.

[1] ftp://ftp.netcom.com/pub/hb/hbaker/Prag-Parse.html
[2] ftp://berlin.ccc.de/pub/gd/contributions/meta-0.5.tar.gz

Chris.
-- 
http://www.double.co.nz/dylan



Follow-Ups: References: