From: Dave Thomas Date: 2002-07-26T05:34:10+09:00 Subject: Re: [PATCH] object.c ruby.h (fwd) GOTO Kentaro writes: > I vote #truth?. If someone asks `why not boolean' we can plead that > Boolean algebra is just one of characterizations but not synonym for > the truth value. If you call Regexp#match with a non-string argument, it calls that argument's to_str method to coerce it into a string. So, perhaps, if the expression to pass to 'if', 'while', and friends isn't 'true' or 'false', the interpreter should call #truth? on it to coerce it into a truth value.[1] If that sounds logical, then perhaps #to_truth might be a more consistent name. Dave [1] Doing this would allow Perl fans to do class String def truth? !empty? end end class Integer def truth? !zero? end end Aarrgh...