On Jul 7, 9:12 pm, "David A. Black" <dbl... / rubypal.com> wrote:
> On Tue, 8 Jul 2008, Yossef Mendelssohn wrote:
> > 2) The length check isn't necessary. It's sufficient to just use
> > args.all? { |a| old_include?(a) }, assuming it's okay that calling
> > include? with no arguments now returns true.
>
> I'd be in favor of keeping that safeguard, partly because it feels
> weird for [1,2,3].include?() to be true and partly because there might
> be some edge case or test where having it succeed silently might be
> problematic.
Oh, I'd probably put a safeguard in there, possibly a check on the
number of arguments so that [1,2,3].include?() still raises an
ArgumentError.
My comment about the length check not being necessary wasn't a
judgement of how I would write it
as much as it was just saying that code doesn't perform any useful
function in that context. Personally, I think [].all? shouldn't be
true, but that debate has happened before.
--
-yossef