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

Re: reading a float?



In article <hX8L4.6255$QX1.232123@typhoon.ne.mediaone.net>, "Scott McKay"
<swm@mediaone.net> wrote:

> Amazingly, there doesn't appear to be such a function!
> There's string-to-integer, integer-to-string, float-to-string, but no
> string-to-float.  I guess it's time for someone to write one!

OK, well that part is easy enough if we punt to C:

   define method-string-to-double(s :: <string>) => (d :: <double-float);
      call-out("atof", double:, ptr: (as(<c-string>, s).raw-value));
   end;

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 ?

somewhere else?

-- Bruce



Follow-Ups: References: