On 11 May 2010 23:39, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
On May 11, 2010, at 9:34 PM, Alexandre Bergel wrote:
testMetaclassSuperclass    "self run: #testMetaclassSuperclass"
   self assert: Dictionary class superclass == Set class.    self assert: OrderedCollection class superclass == SequenceableCollection class.
What is the important is the metaclass relationship, and not really the fact that Dictionary is a subclass of Set. I think this is better: Â Â Â self assert: Dictionary class superclass == Dictionary superclass class. Â Â Â self assert: OrderedCollection class superclass == OrderedCollection superclass class.
ok but do you think that the system would work if such test would not work?
I dont quite understand, what this test testing. Yes, in ST-80, a class inheritance chain and metaclass inheritance chain must go in parallel. But there's nothing in VM (to my knowledge), which prevents you from sidestepping from this convention. This means, that a system may work even if such test will fail. I made my own experiments with it , by creating a prototype-based framework , and along with existing prototypes implementation, it serves as a proof, that its not critical for a system to organize your behaviors strictly only in such way(s).
I would rewrite the test as:
testSuperclass    "self debug: #testSuperclass"
   | s b |
   s := OrderedCollection new.    b := [:cls | cls ifNotNil: [s add: cls. b value: cls superclass] ].    b value: OrderedCollection.
   self assert: OrderedCollection allSuperclasses = s allButFirst.    self assert: OrderedCollection withAllSuperclasses = s.
You even test #withAllSuperclasses in that case.
this one is more interesting _______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.