[#1026] Is this a bug? — Dave Thomas <Dave@...>

18 messages 2000/01/03

[#1084] Infinite loop — Dave Thomas <Dave@...>

17 messages 2000/01/11

[#1104] The value of while... — Dave Thomas <Dave@...>

24 messages 2000/01/11

[ruby-talk:01023] Re: a question about to_i

From: "Conrad Schneiker" <schneiker@...>
Date: 2000-01-02 07:36:50 UTC
List: ruby-talk #1023
From note of Clemens Hintze:

> Hi,
>
> Yukihiro Matsumoto writes:
> > Hi,
> >
[...]
>
> IMHO the '.to_x' methods could remain as they are!
>
> [...]
>
> >
> > The another option is to raise exception for non-numeric string at
> > every string->integer convsersion.  There's no strong reason to return
> > zero for non-numeric strings in Ruby.  e.g.
>
> That, I think, is not necessary. Sometimes it is right pretty to have
> to_x methods behaving as they do currently!
>
> [...]

Would you give us some examples?

Unless "sometimes" == "more often than not", I would strongly prefer raising
exceptions for what normally are (or should be) regarded as error
conditions.

Conrad

In This Thread

Prev Next