From: Dave Thomas Date: 2001-10-30T00:07:59+09:00 Subject: [ruby-talk:23727] Re: ref. constructors and new (was: Re: class Foo does not call Class.new?) "Rich Kilmer" writes: > The parser would have to know that when you call: > > String.new("text") > > it is a special case because when you call: > > Foo.new("text") => Foo.new(String.new("text")) > > you don't want: > > String.new("text") => String.new(String.new("text")) Foo.new("text") would be executed as str = String.new() str.initialize(str) Foo.new(str) To be consistent, the internal representation of "text" might well be an Array of integers (or characters if we end up with a Character class). I'm not saying this is efficient, but I think it is possible. Dave