Levente Uzonyi uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-hsj.547.mcz
==================== Summary ====================
Name: Kernel-hsj.547
Author: hsj
Time: 16 February 2011, 1:45:07.199 pm
UUID: 46e9ff86-8023-4720-a146-7eb8a2d2fb30
Ancestors: Kernel-fbs.546
Fixes inconsistency in return value of adoptInstance: on different VM's.
=============== Diff against Kernel-fbs.546 ===============
Item was changed:
----- Method: Behavior>>adoptInstance: (in category 'instance creation') -----
adoptInstance: anInstance
"Change the class of anInstance to me.
+ Primitive (found in Cog and new VMs) follows the same rules as primitiveChangeClassTo:, but returns the class rather than the modified instance"
- Primitive (only found in Cog) should follow the same rules as described in primitiveChangeClassTo:"
<primitive: 160 error: ec>
+ anInstance primitiveChangeClassTo: self basicNew.
+ ^self!
- ^anInstance primitiveChangeClassTo: self basicNew.!
Levente Uzonyi uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-hsj.547.mcz
==================== Summary ====================
Name: Kernel-hsj.547
Author: hsj
Time: 16 February 2011, 1:45:07.199 pm
UUID: 46e9ff86-8023-4720-a146-7eb8a2d2fb30
Ancestors: Kernel-fbs.546
Fixes inconsistency in return value of adoptInstance: on different VM's.
=============== Diff against Kernel-fbs.546 ===============
Item was changed:
----- Method: Behavior>>adoptInstance: (in category 'instance creation') -----
adoptInstance: anInstance
"Change the class of anInstance to me.
+ Primitive (found in Cog and new VMs) follows the same rules as primitiveChangeClassTo:, but returns the class rather than the modified instance"
- Primitive (only found in Cog) should follow the same rules as described in primitiveChangeClassTo:"
<primitive: 160 error: ec>
+ anInstance primitiveChangeClassTo: self basicNew.
+ ^self!
- ^anInstance primitiveChangeClassTo: self basicNew.!
Levente Uzonyi uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-hsj.547.mcz
==================== Summary ====================
Name: Kernel-hsj.547
Author: hsj
Time: 16 February 2011, 1:45:07.199 pm
UUID: 46e9ff86-8023-4720-a146-7eb8a2d2fb30
Ancestors: Kernel-fbs.546
Fixes inconsistency in return value of adoptInstance: on different VM's.
=============== Diff against Kernel-fbs.546 ===============
Item was changed:
----- Method: Behavior>>adoptInstance: (in category 'instance creation') -----
adoptInstance: anInstance
"Change the class of anInstance to me.
+ Primitive (found in Cog and new VMs) follows the same rules as primitiveChangeClassTo:, but returns the class rather than the modified instance"
- Primitive (only found in Cog) should follow the same rules as described in primitiveChangeClassTo:"
<primitive: 160 error: ec>
+ anInstance primitiveChangeClassTo: self basicNew.
+ ^self!
- ^anInstance primitiveChangeClassTo: self basicNew.!
Levente Uzonyi uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ul.549.mcz
==================== Summary ====================
Name: Kernel-ul.549
Author: ul
Time: 28 February 2011, 12:23:58.143 pm
UUID: 63637401-6781-ce44-99e2-d3ac7f032112
Ancestors: Kernel-dtl.548, Kernel-hsj.547
Merged.
=============== Diff against Kernel-dtl.548 ===============
Item was changed:
----- Method: Behavior>>adoptInstance: (in category 'instance creation') -----
adoptInstance: anInstance
"Change the class of anInstance to me.
+ Primitive (found in Cog and new VMs) follows the same rules as primitiveChangeClassTo:, but returns the class rather than the modified instance"
- Primitive (only found in Cog) should follow the same rules as described in primitiveChangeClassTo:"
<primitive: 160 error: ec>
+ anInstance primitiveChangeClassTo: self basicNew.
+ ^self!
- ^anInstance primitiveChangeClassTo: self basicNew.!
Levente Uzonyi uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ul.549.mcz
==================== Summary ====================
Name: Kernel-ul.549
Author: ul
Time: 28 February 2011, 12:23:58.143 pm
UUID: 63637401-6781-ce44-99e2-d3ac7f032112
Ancestors: Kernel-dtl.548, Kernel-hsj.547
Merged.
=============== Diff against Kernel-dtl.548 ===============
Item was changed:
----- Method: Behavior>>adoptInstance: (in category 'instance creation') -----
adoptInstance: anInstance
"Change the class of anInstance to me.
+ Primitive (found in Cog and new VMs) follows the same rules as primitiveChangeClassTo:, but returns the class rather than the modified instance"
- Primitive (only found in Cog) should follow the same rules as described in primitiveChangeClassTo:"
<primitive: 160 error: ec>
+ anInstance primitiveChangeClassTo: self basicNew.
+ ^self!
- ^anInstance primitiveChangeClassTo: self basicNew.!
Levente Uzonyi uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ul.549.mcz
==================== Summary ====================
Name: Kernel-ul.549
Author: ul
Time: 28 February 2011, 12:23:58.143 pm
UUID: 63637401-6781-ce44-99e2-d3ac7f032112
Ancestors: Kernel-dtl.548, Kernel-hsj.547
Merged.
=============== Diff against Kernel-dtl.548 ===============
Item was changed:
----- Method: Behavior>>adoptInstance: (in category 'instance creation') -----
adoptInstance: anInstance
"Change the class of anInstance to me.
+ Primitive (found in Cog and new VMs) follows the same rules as primitiveChangeClassTo:, but returns the class rather than the modified instance"
- Primitive (only found in Cog) should follow the same rules as described in primitiveChangeClassTo:"
<primitive: 160 error: ec>
+ anInstance primitiveChangeClassTo: self basicNew.
+ ^self!
- ^anInstance primitiveChangeClassTo: self basicNew.!
Levente Uzonyi uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-ul.423.mcz
==================== Summary ====================
Name: System-ul.423
Author: ul
Time: 28 February 2011, 12:05:19.782 pm
UUID: 5334bfde-1537-fa4a-8491-4219f54632ce
Ancestors: System-ul.422
- moved all class and trait access logic from SmalltalkImage to SystemDictionary
- simplified a few methods in SystemDictionary
=============== Diff against System-ul.422 ===============
Item was changed:
----- Method: SmalltalkImage>>allClasses (in category 'classes and traits') -----
allClasses
"Return all the class defined in the system"
+ ^globals allClasses!
- ^Array streamContents:[:s| self allClassesDo:[:aClass| s nextPut: aClass]].!
Item was changed:
----- Method: SmalltalkImage>>allClassesAndTraits (in category 'classes and traits') -----
allClassesAndTraits
"Return all the classes and traits defined in the system"
+ ^globals allClassesAndTraits!
- ^Array streamContents:[:s| self allClassesAndTraitsDo:[:each| s nextPut: each]].!
Item was changed:
----- Method: SmalltalkImage>>allClassesAndTraitsDo: (in category 'classes and traits') -----
allClassesAndTraitsDo: aBlock
"Evaluate the argument, aBlock, for each class and trait in the system."
+ globals allClassesAndTraitsDo: aBlock!
- self allClassesDo: aBlock.
- self allTraitsDo: aBlock.
- !
Item was changed:
----- Method: SmalltalkImage>>allClassesDo: (in category 'classes and traits') -----
allClassesDo: aBlock
"Evaluate the argument, aBlock, for each class in the system."
+ globals allClassesDo: aBlock!
- ^globals allClassesDo: aBlock!
Item was changed:
----- Method: SmalltalkImage>>allTraits (in category 'classes and traits') -----
allTraits
"Return all traits defined in the system"
+ ^globals allTraits!
- ^Array streamContents:[:s| self allTraitsDo:[:aTrait| s nextPut: aTrait]].!
Item was changed:
----- Method: SmalltalkImage>>allTraitsDo: (in category 'classes and traits') -----
allTraitsDo: aBlock
"Evaluate the argument, aBlock, for each trait in the system."
+ globals allTraitsDo: aBlock!
- ^globals allTraitsDo: aBlock!
Item was changed:
----- Method: SmalltalkImage>>classNames (in category 'classes and traits') -----
classNames
"Answer a collection of all class names in the system."
+ ^globals classNames!
- ^self allClasses collect:[:aClass| aClass name].!
Item was changed:
----- Method: SmalltalkImage>>traitNames (in category 'classes and traits') -----
traitNames
"Answer a SortedCollection of all traits (not including class-traits) names."
+ ^globals traitNames!
- ^self allTraits collect:[:aTrait| aTrait name].!
Item was changed:
----- Method: SystemDictionary>>allClassesAndTraits (in category 'classes and traits') -----
allClassesAndTraits
"Return all the classes and traits defined in the Smalltalk SystemDictionary"
+ ^Array streamContents: [ :stream |
+ self allClassesAndTraitsDo: [ :each | stream nextPut: each ] ]!
- ^ self classNames , self traitNames collect: [:each | self at: each]!
Item was changed:
----- Method: SystemDictionary>>allClassesAndTraitsDo: (in category 'classes and traits') -----
allClassesAndTraitsDo: aBlock
+
+ self
+ allClassesDo: aBlock;
+ allTraitsDo: aBlock!
- ^self allClassesAndTraits do: aBlock!
Item was changed:
----- Method: SystemDictionary>>allClassesDo: (in category 'classes and traits') -----
allClassesDo: aBlock
"Evaluate the argument, aBlock, for each class in the system."
+ self classNames do: [ :name |
+ aBlock value: (self at: name) ]!
- (self classNames collect: [:name | self at: name]) do: aBlock!
Item was changed:
----- Method: SystemDictionary>>allTraitsDo: (in category 'classes and traits') -----
allTraitsDo: aBlock
"Evaluate the argument, aBlock, for each trait in the system."
+ self traitNames do: [ :name |
+ aBlock value: (self at: name) ]!
- (self traitNames collect: [:name | self at: name]) do: aBlock!
Item was changed:
----- Method: SystemDictionary>>classAndTraitNames (in category 'classes and traits') -----
classAndTraitNames
"Answer a sorted collection of all class and trait (not including class-traits) names. The performance of this algorithm is O(n) if the classNames are already cached, otherwise O(n*log(n)) where n is self size."
| classNames traitNames result temporary |
classNames := self classNames.
+ traitNames := self traitNames ifEmpty: [ ^classNames ].
- traitNames := self traitNames.
- traitNames ifEmpty: [^classNames].
temporary := Array new: classNames size + traitNames size.
result := temporary shallowCopy.
temporary
replaceFrom: 1
to: classNames size
with: classNames
startingAt: 1;
replaceFrom: classNames size + 1
to: temporary size
with: traitNames
startingAt: 1;
mergeFirst: 1
middle: classNames size
last: temporary size
into: result
by: nil.
^result!