The Trunk: Kernel-tfel.1040.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Kernel-tfel.1040.mcz

commits-2
Tim Felgentreff uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-tfel.1040.mcz

==================== Summary ====================

Name: Kernel-tfel.1040
Author: tfel
Time: 27 September 2016, 2:57:29.665629 pm
UUID: e6781812-fc7b-a546-818b-0b16c5d62e88
Ancestors: Kernel-tfel.1039

refactor newSubclass to go through the more general newUniqueClassInstVars:classInstVars: method.

=============== Diff against Kernel-tfel.1039 ===============

Item was changed:
  ----- Method: Class>>newSubclass (in category 'subclass creation') -----
  newSubclass
- | i className |
- i := 1.
- [className := (self name , i printString) asSymbol.
- self environment includesKey: className]
- whileTrue: [i := i + 1].
 
+ ^ self newUniqueClassInstVars: '' classInstVars: ''
- ^ self subclass: className
- instanceVariableNames: ''
- classVariableNames: ''
- poolDictionaries: ''
- category: Object categoryForUniclasses
 
  "Point newSubclass new"!

Item was changed:
  ----- Method: Object class>>newUniqueClassInstVars:classInstVars: (in category 'instance creation') -----
  newUniqueClassInstVars: instVarString classInstVars: classInstVarString
  "Create a unique class for the receiver"
 
  | aName aClass |
  self isSystemDefined ifFalse:
  [^ superclass newUniqueClassInstVars: instVarString classInstVars: classInstVarString].
  aName := self chooseUniqueClassName.
  aClass := self subclass: aName instanceVariableNames: instVarString
  classVariableNames: '' poolDictionaries: '' category: self categoryForUniclasses.
+ classInstVarString size > 0 ifTrue:
+ [aClass class instanceVariableNames: classInstVarString].
  self flag: #todo. self flag: #uniclasses. "Discuss if we really want to hide uniclasses again"
  aClass environment forgetClass: aClass logged: false.
  self removeSubclass: aClass.
- classInstVarString size > 0 ifTrue:
- [aClass class instanceVariableNames: classInstVarString].
  ^ aClass!