Re: File.join oddity ?

From: Johan Holmberg <holmberg@...>
Date: 2004-04-26 17:14:13 UTC
List: ruby-core #2822
On Tue, 27 Apr 2004, Berger, Daniel wrote:

> > Wouldn't it be more natural if File.join only accepted
> > strings (or "string-like" objects ) as arguments ?
>
> This sounds like a subtle way of asking for type-checking.  I vote no.
>

Yes. Like in other file-related methods:

   $ ruby -e 'File.open(Object.new)'
   -e:1:in `initialize': cannot convert Object into String (TypeError)


/Johan Holmberg



In This Thread