2011/6/10 Ilias Lazaridis <ilias / lazaridis.com>: > you say: "Individual string objects" > > Those are *not* String objects, as their related initialize > method was not called Um, yes, they are String objects. Having String.initialize called is not required to have a String object. Even ignoring literals, the usual requirement to get an object of a given class in Ruby is to call the class's allocate method. Calling "Klass.new" is a convenience wrapper which is equivalent to calling Klass.allocate.initialize > > The "initialize" method is the constructor. No its not. "initialize" isn't even *a* constructor. The default/standard constructor is the class method "new", which calls the class method "allocate" to get a new object of the class, and then calls the instance method "initialize" on the new object. > By definition, an object *must* call the constructor, to become > an instance of the class. If one accepts that definition, the only thing you might argue is a "constructor" in Ruby is the class method "allocate", since even ignoring literals, calling the class method "allocate" is the only prerequisite for getting an object of the class (the class method "new" will return an object of the class, but it is by calling "allocate" that it gets that object, not by the subsequent call to "initialize", which, as an instance method of the class, requires that the instance already exist before it can be called.) > >> I don't feel >> any need to call the (redefined) initialize method for string >> literals, that already initialized at the compile time. > > This is not about "feelings" and "needs", but about strictness. Yes, and, strictly, you are wrong. > If I use a valid language-construct to override the constructor, > then the language *must* call the modified constructor in > order to be compliant to the OO-model/language. No definition I've ever seen of the OO model requires that a class have only one constructor, nor does any version of the OO model require that objects specified as literals be equivalent to calling the default constructor with an argument that is some function of the specified literal. I can't actually think of any actual language that fits that definition of the OO model. > > Here I'm asking here the public (including you of course), if > there's a workaround available / possible. No. Its not even *logically* possible, much less practical. > > Neither here, nor on the issue-track I've asked you to "change > the language (or its object model)", but to deal with an > inconsistency - at least to acknowledge the known issue. The only issue here is that you have an incoherent understanding of the OO model (I use incoherent in a strict sense: specifically, that it requires something which is logically inconsistent.) > "Ruby 2.0 - Everything First Class Objects" > > Or can it become ruby 1.9.5? That would be a nice goal. The problem with your criticism is that you are aiming it in the wrong direction: literals are first-class objects and don't need changed -- OTOH, blocks and methods aren't (though its possible in each case to create an object from them, which mitigates but doesn't eliminate the issue.)