Hello Tom,

Friday, January 17, 2003, 4:50:43 PM, you wrote:
>> ((not ameth.to_s.empty?) and ...) rescue 0

TS> thanks, this seems the most concise answer, although i hesitate to use rescue. 
TS> is it exceedingly slow to do so?

i dont know. on the my side, i like 'when NACK' idea - may be because
it is close to pattern matching (in functional programming). in one
program i used 3rd variant, smth like:

def f(arr)  # arr may be Array or nil
  arr.flatten.size || 0
end

class NilClass
  def flatten
    nil
  end
  def size
    nil
  end
end

-- 
Best regards,
 Bulat                            mailto:bulatz / integ.ru