On 9/20/06, MonkeeSage <MonkeeSage / gmail.com> wrote: > Austin Ziegler wrote: > > > No, you better not. If I use #<<, then I can "write" to a String, a > > StringIO, an IO (socket, file, etc.), or an Array. Checking for #write > > limits you to (mostly) actual IO objects. > > Then you'd be asking if the object _acts like_ (quacks like) an > enumerable, would you not? Why wrap that in a begin....rescue clause > and only spot it after the fact when you can catch it ahead of time? > Certainly it doesn't violate duck-typing to ask what an object acts > like (which is what imposing conditions on an object would be doing)?! > Because with duck typing, you break exactly at the point where an object doesn't behave like it's supposed to, not before or (worse) later. > Regards, > Jordan > > > -- - Simen