[Nickle] string_to_integer() should raise an exception?

Bart Massey bart at cs.pdx.edu
Mon Jun 9 18:53:56 PDT 2003


In message <E19PXEv-00025v-00 at localhost> you wrote:
> 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.

Which begs the question of the name change :-).  IMHO, it's
always been a bug in libc atoi() as well: I'd be much
happier to have it lose on garbage.  One can catch the
exception if they must, and actually do something sensible.
Heck, have the exception pass the partial conversion as an
argument... Am I confused here?

	Bart



More information about the Nickle mailing list