From: Paul Brannan Date: 2002-06-25T02:11:07+09:00 Subject: Re: No exceptions from String#to_i On Tue, Jun 25, 2002 at 12:27:03AM +0900, Yukihiro Matsumoto wrote: > Functional style methods are more strict than their OO style > counterpart in general. Unfortunately, it's not possible to do this with user-defined data types. If I have a String-like class with a to_i method that I want to return 0 on error, then I can do that, but then Integer() will also return 0 on error. If I want Integer() to raise an exception on error, then to_i must also raise an exception on error. It's not good to have a standard library feature that user libraries cannot emulate. Paul