Class new title: Class subclassof: Object fields: 'title " for identification, printing" myinstvars " partnames for compiling, printing" instsize " for storage management" messagedict " for communication, compiling" classvars " compiler checks here" superclass " for execution of inherited behavior" environment " for external refs" fieldtype' declare: 'lastClass lastParagraph lastSelector '  t1 [classvars  t1]  t1 _ t2 [classvars  t1 _ t2] Isa: t1 [superclass  t1  [true] superclass  nil  [false] superclass Isa: t1] abstract [self fields: nullString] allInstances [NoteTaker  [user notify: 'not implemented'] self allInstancesEver notNil] allInstancesEver | t1 t2 t3 t4 [NoteTaker  [user notify: 'not implemented'] t3 _ Vmem pclassesOf: self. t2 _ Vector new: 128 * t3 length. for t4 to: t3 length do [t2  (t4 - 1 * 128 + 1 to: t4 * 128) all_ t3  t4]. thisContext destroyAndReturn: (self fromFreelist: Class instsize fill: t2)] bytesize: t1 [self  self realself  [self realself bytesize: t1] NoteTaker  [instsize _ (instsize land: 8191) + [t1 = 8  [0] 16384]] fieldtype _ 32 + [t1 = 8  [8] 16]] canUnderstand: t1 [messagedict has: t1  [self] superclass  nil  [false] superclass canUnderstand: t1] canunderstand: t1 [messagedict has: t1] category [SystemOrganization invert: self title unique] category: t1 [t1 is: String  [SystemOrganization add: self title unique under: t1] user notify: 'Category name must be a String'] classInit [self new classInit] classvars [classvars] clean | t1 [for t1 from: classvars do [t1  ClassOrganization and (classvars ref: t1) refct = 1  [classvars delete: t1]]] code: t1 [[t1  lastSelector and self  lastClass  [] lastParagraph _ [t1 = ClassOrganization  [self organization] NoteTaker or (mem  482 land: 64) = 0  [self decompile: t1] messagedict code: t1] asParagraph. lastClass _ self. lastSelector _ t1]. lastParagraph] compileall | t1 t2 [for t1 from: messagedict do [t2 _ messagedict code: t1. self understands: t2 asParagraph. messagedict code: t1 _ t2]. [self  Object  [nil installError]]. Changes init. MessageDict new freeMethods] copy: t1 | t2 t3 [t2 _ self new. for t3 to: self instsize do [t2 instfield: t3 _ t1 instfield: t3]. t2] copy: t1 from: t2 [self copy: t1 from: t2 classified: nil] copy: t1 from: t2 classified: t3 | t4 t5 [t1 is: Vector  [for t4 from: t1 do [self copy: t4 from: t2 classified: t3]] t1 is: String  [self copy: (t2 organization category: t1) from: t2 classified: t3] t5 _ t2 code: t1. t5  nil  [] [t3  nil  [t3 _ t2 organization invert: t1]]. [messagedict has: t1  [t5 text = (self code: t1) text  [] user notify: title + ' ' + t1 + ' will be redefined if you proceed.']]. self understands: t5 classified: t3] copyof: t1 subclassof: t2 [title _ t1 title. self subclassof: t2. classvars _ t1 classvars. environment _ t1 environment. self newFieldsForSubClass: t1 myinstvars] declare: t1 | t2 t3 [self  self realself  [self realself declare: t1] [classvars  nil  [classvars _ SymbolTable init]]. t1 is: String  [self declare: t1 asVector] t3 _ false. [t1 is: Vector  [for t2 from: t1 do [(Smalltalk has: t2) or: (Undeclared has: t2)  [t3 _ true]]] (Smalltalk has: t1) or: (Undeclared has: t1)  [t3 _ true]]. [t3  [user notify: 'Methods recompile if you proceed, global became local']]. [t1 is: Vector  [for t2 from: t1 do [classvars insert: t2 with: nil]] classvars insert: t1 with: nil]. t3  [self compileall]] decompile: t1 [user displayoffwhile [Decompiler new decompile: t1 class: self]] default [self new default] definition | t1 [t1 _ (String new: 50) asStream. self printdefon: t1. t1 contents] derstands: t1 | t2 [t1 is: Vector  [for t2 from: t1 do [self derstands: t2]] (messagedict has: t1)  false  [] messagedict _ messagedict delete: t1. self organization delete: t1. lastClass _ nil. lastSelector _ lastClass. lastParagraph _ lastSelector. t2 _ title + ' ' + t1. Changes has: t2  [Changes delete: t2]] describe: t1 on: t2 | t3 t4 [t4 _ self. until [t4  nil  [t4 _ self. t3 _ ?. t3] t3 _ t4 md invert: t1. t3] do [t4 _ t4 superclass]. t2 append: t4 title. t2 space. t2 append: t3] ed: t1 | t2 t3 [t2 _ self code: t1. user clearshow: t2. while [t3 _ user request: 'substitute: '. t3] do [t2 _ t2 subst: t3 for: (user request: 'for: '). user clearshow: t2]. self understands: t2] edit: t1 | t2 t3 t4 [t2 _ [t1 = ClassOrganization  [self organization asParagraph] messagedict has: t1  [self code: t1] nullString asParagraph]. self edit: t1 para: t2 formerly: false] edit: t1 para: t2 formerly: t3 [user leaveTop. user restartup: (CodeWindow new class: self selector: t1 para: t2 formerly: t3)] environment [environment] environment_ t1 [environment _ t1] execute: t1 [self understands: 'doit [' + t1 + ']'. self new doit] fieldNamesInto: t1 [[superclass  nil  [] superclass fieldNamesInto: t1]. (Reader new of: myinstvars) readInto: t1] fields: t1 | t2 t3 t4 t5 t6 [myinstvars _ t1. messagedict _ MessageDict init. t2 _ self realself. t3 _ self instvars. t6 _ HashSet init. for t5 from: t3 do [t6 has: t5  [user notify: t5 + ' is used already (maybe in superclass)'] t6 insert: t5]. self = t2  [self initClass] t4 _ t2 instvars. t3 = t4  [t2 environment_ nil. t2 myinstvars_ myinstvars. t2 subclassof: superclass] [t2 howMany > 0  [user notify: 'All ' + title + 's become obsolete if you proceed...']]. classvars _ t2 classvars. messagedict _ t2 md copy. [t3 length  t4 length or t3  (1 to: t4 length)  t4  [user notify: title + ' methods recompile if you proceed...'. self compileall]]. t2 md init. self fixSubClassesOf: t2. t2 obsolete. Smalltalk  title unique _ self. self initClass] fixSubClassesOf: t1 | t2 t3 [for t2 from: user classNames do [t3 _ Smalltalk  t2. t3 superclass  t1  [Class new copyof: t3 subclassof: self]]] fromFreelist: t1 fill: t2 [user croak] primitive: 53 howMany | t1 [t1 _ self allInstancesEver. thisContext destroyAndReturn: t1 length - (t1 count: nil)] init [self new init] init: t1 [self new init: t1] initClass [fieldtype _ 16. instsize _ self instvars length. instsize > 256  [user notify: 'too many instance variables'] [NoteTaker  [instsize _ instsize + 1 * 2 + 8192]]. self organization] install: t1 method: t2 literals: t3 code: t4 backpointers: t5 [messagedict _ messagedict insert: t1 method: t2 literals: t3 code: t4 asParagraph makeBoldPattern backpointers: t5. lastClass _ self. lastSelector _ t1. lastParagraph _ t4. Changes insert: title + ' ' + t1] instfield: t1 [t1 > Class instsize  [user notify: 'arg too big'] super instfield: t1] instsize [NoteTaker  [instsize allmask: 8192  [(instsize land: 2047) / 2 - 1] 0] [fieldtype  32  [0] self  Class  [instsize - 1] self  VariableLengthClass  [instsize - 20] instsize]] instvars [self fieldNamesInto: FieldNameCollector default] invertRef: t1 | t2 t3 t4 t5 t6 t7 t8 [t1 isnt: Vector  [(self invert: t1 inVector)  1] t3 _ (self wholeEnvironment concat: Undeclared , Smalltalk) asStream. t4 _ Dictionary init. t1 transform [t5] to [t2 _ self. t3 reset. while [t7 _ t3 next. [t7  false  [t6 _ 'unknown ' concat: t5 asOop base8. t6] [t2  nil and t7  t2 classvars  [t8 _ t2 title. t2 _ t2 superclass] t8 _ false]. t6 _ t7 invertRef: t5. [t6  false  [false] [t8  [] t8 _ t4 lookup: t7. t8  [] t8 _ Smalltalk invert: t7. t4 insert: t7 with: t8]. t6 _ (t8 concat: ' ') concat: t6. t6]]  false] do []. t6]] md [messagedict] messages [messagedict contents , ClassOrganization] method: t1 [messagedict methodorfalse: t1] moveFromCat: t1 to: t2 [(t1 is: String) and (t2 is: String)  [SystemOrganization move: self title unique from: t1 to: t2] user notify: 'Category name must be a String'] myinstvars [myinstvars] myinstvars_ t1 [myinstvars _ t1] new [user croak] primitive: 27 new: t1 [self new init: t1] newFieldsForSubClass: t1 | t2 t3 t4 [myinstvars _ t1. messagedict _ MessageDict init. t2 _ self realself. self = t2  [user notify: 'problem in class redefinition. See coment at end of method'] t4 _ t2 instvars. t3 _ self instvars. t3 = t4  [user notify: 'problem in class redefinition. See coment at end of method'] [t2 howMany > 0  [user cr show: 'All ' + title + 's are obsolete.']]. classvars _ t2 classvars. messagedict _ t2 md copy. t2 md init. [t3 length  t4 length or t3  (1 to: t4 length)  t4  [user cr show: title + ' recompiled.'. self compileall]]. self fixSubClassesOf: t2. t2 obsolete. Smalltalk  title unique _ self. self initClass] noChanges | t1 t2 [t2 _ title + ' *'. for t1 from: Changes contents do [t2 match: t1  [Changes delete: t1]]] notify: t1 at: t2 in: t3 [self notify: t1 at: t2 in: t3 for: self] obsolete [title _ 'AnObsolete' + title. classvars _ nil. messagedict close. environment _ self. superclass _ Object] organization | t1 t2 [[classvars  nil  [self declare: ClassOrganization]]. t1 _ classvars lookup: ClassOrganization. t1 is: ClassOrganizer  [t1] t2 _ AllClassOrganization. t2  1  self  [t2  2] user displayoffwhile [t1 _ ClassOrganizer new init: messagedict contents sort. t1]. AllClassOrganization _ self , t1. t1] print: t1 on: t2 | t3 t4 [t3 _ self instvars. t2 append: '('. t2 append: title. t2 append: ' new '. for t4 to: instsize do [t2 append: t3  t4. t2 append: ': '. t2 print: (t1 instfield: t4). t2 space]. t2 append: ')'] printdefon: t1 | t2 [t1 append: self class title. t1 append: ' new title: '. t1 append: title unique. t1 cr. t1 tab. t1 append: 'subclassof: ' + [superclass  nil  ['nil'] superclass title]. t1 cr. t1 tab. t1 append: 'fields: ' + myinstvars asString. t1 cr. t1 tab. t1 append: 'declare: '''. for t2 from: classvars contents do [t2 = ClassOrganization  [] t1 append: t2. t1 space]. t1 append: ''''. [NoteTaker  [instsize nomask: 16384  [t1 semicrtab. t1 append: 'bytesize: '. t1 print: (instsize anymask: 8192)]] [fieldtype  16  [t1 semicrtab. t1 append: 'bytesize: '. t1 print: fieldtype - 32]]. t2 _ self instvars. instsize  t2 length  [t1 semicrtab. t1 append: 'veryspecial: '. t1 print: instsize - t2 length]]. environment  nil  [] for t2 from: environment do [t1 semicrtab. t1 append: 'sharing: ' + (Smalltalk invert: t2)]] printon: t1 [t1 append: 'Class ' + title] realself [Smalltalk  title unique] recopy: t1 | t2 t3 [t2 _ self new. for t3 to: self instsize do [t2 instfield: t3 _ (t1 instfield: t3) recopy]. t2] rename: t1 | t2 t3 t4 t5 [t2 _ title unique. t3 _ t1 unique. [Smalltalk has: t3  [t4 _ Smalltalk  t3. user notify: 'All ' + t1 + 's will become obsolete if you proceed'. t4 obsolete] t5 _ SystemOrganization invert: t2. AllClassNames _ AllClassNames insertSorted: t3. SystemOrganization classify: t3 under: t5]. Smalltalk delete: t2. AllClassNames _ AllClassNames delete: t2. SystemOrganization delete: t2. title _ t1. Smalltalk declare: t3 as: self] selectors [self messages] sharing: t1 [self  self realself  [self realself sharing: t1] environment _ environment asVector , t1] shrink [messagedict _ messagedict shrink] space | t1 t2 [t2 _ 0. for t1 from: messagedict do [t2 _ t2 + (messagedict method: t1) length]. t2] subclassof: t1 [superclass _ t1. (superclass isnt: Class) and (superclass isnt: VariableLengthClass)  [user notify: 'Superclass is not yet defined or not a Class']] superclass [superclass] title [title] title: t1 [title _ t1. title _ title unique. self title: title insystem: Smalltalk] title: t1 insystem: t2 | t3 [superclass _ Object. [t2 has: t1  [t3 _ (t2  t1) class. t3  self class  [self] user notify: t1 + ' will change from a ' + t3 title + ' to a ' + self class title + ' if you proceed...']]. t2 declare: t1 as: self. AllClassNames _ AllClassNames insertSorted: t1. SystemOrganization classify: t1 under: 'As yet unclassified'] title: t1 subclassof: t2 fields: t3 declare: t4 [t1  1  (t1  1) asUppercase  [user notify: 'Please capitalize each word in class title: ' + t1. false] self title: t1. self subclassof: t2. self fields: t3. self declare: t4] understands: t1 | t2 t3 [self understands: t1 classified: 'As yet unclassified'] understands: t1 classified: t2 [Generator new compile: t1 asParagraph in: self under: 'As yet unclassified' notifying: self] veryspecial: t1 [instsize _ self instvars length + t1] wholeEnvironment [(classvars asVector concat: environment asVector) concat: [superclass  nil  [()] superclass wholeEnvironment]] whosends: t1 | t2 t3 t4 [t2 _ Stream default. for t4 from: messagedict do [for t3 from: (messagedict literals: t4) do [t1  t3  [t2 append: t4. t2 space]]]. t2 contents]