Hi
I’m spotting real inconsistency in the specification and use of newFrom:
In Pharo and Object we have
newFrom: aSimilarObject
"Create an object that has similar contents to aSimilarObject. If the classes have any instance variables with the same names, copy them across. If this is bad for a class, override this method."
^ (self isVariable
ifTrue: [self basicNew: aSimilarObject basicSize]
ifFalse: [self basicNew]) copySameFrom: aSimilarObject
The ANSI standard does not define newFrom:
Now in Pharo some classes such dictionary expect as argument a dictionary but OrderedDictionary expects a like of association!
Set expects a collection,
Bag too and many others.
CompiledMethod expects a compiledMethod
I think that it would be good to strengthen this method and we could define newFromSibling: but it looks like a copy to me.
S
--------------------------------------------
Stéphane Ducasse
03 59 35 87 52
Assistant: Aurore Dalle
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley,
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France