From: ts Date: 2004-10-25T01:12:47+09:00 Subject: Re: [rcr] String#first / String#last >>>>> "t" == trans (T Onoma) writes: t> On Sunday 24 October 2004 09:52 am, Simon Strandgaard wrote: t> | unless n.kind_of?(Integer) t> | raise TypeError, "#{length.class}#to_int should return Integer" t> | end t> I don't think this is really needed, since such a bug would be worked out else t> where. (That #to_int might be used usefully for something other then t> returning an integer is extremely unlikely and thus not worth the check). svg% ruby -e 'class A; def to_int() "a" end end; [1,2].first(A.new)' -e:1:in `first': A#to_int should return Integer (TypeError) from -e:1 svg% Guy Decoux