[Nickle] string_to_integer() should raise an exception?

Keith Packard keithp at keithp.com
Mon Jun 9 18:43:53 PDT 2003


Around 20 o'clock on Jun 1, Bart Massey wrote:

> Shouldn't string_to_integer() raise an exception rather than
> silently throwing away bogus characters?

string_to_integer follows the atoi semantics which say to stop when the 
first invalid character is found.

> BTW, I've added atoi() and atof() as synonyms for
> string_to_real() and string_to_integer().  I couldn't stand
> it anymore...

Seems sensible enough.

-keith





More information about the Nickle mailing list