Class new title: Array subclassof: Object fields: '' declare: ''  t1 [t1 subscripts: self]  t1 _ t2 [t1 subscripts: self _ t2] + t1 [self concat: t1] < t1 [self  1 < (t1  1)] = t1 | t2 [t1 isArray  [self length  t1 length  [false] for t2 to: self length do [self  t2 = (t1  t2)  [] false]. true] false] > t1 [self  1 > (t1  1)] all t1 suchThat t2 | t3 t4 t5 [t3 _ (self species new: self length) asStream. for t4 to: self length do [t5 _ self  t4. t1 value_ t5. t2 eval  [t3 next_ t5]]. t3 contents] all_ t1 | t2 [for t2 to: self length do [self  t2 _ t1]] asSet [Set new of: self to: self length] asStream [Stream new of: self] cansubscript: t1 | t2 [for t2 from: self do [t2 cansubscript: t1  [] false]] concat: t1 | t2 t3 [t2 _ self species new: self length + t1 length. t3 _ t2 asStream. self copyto: t3. t1 copyto: t3. t2] copy [self copy: 1 to: self length] copy: t1 to: t2 [self copy: t1 to: t2 to: (self species new: t2 - t1 + 1)] copy: t1 to: t2 to: t3 | t4 t5 t6 [t5 _ t3 asStream. t6 _ Stream new of: self from: t1 to: t2. for t4 from: t1 to: t2 do [t5 next_ t6 next]. t3] copyto: t1 [self copy: 1 to: self length to: t1] count: t1 | t2 t3 [t3 _ 0. for t2 to: self length do [t1 = (self  t2)  [t3 _ t3 + 1]]. t3] delete: t1 | t2 t3 [t2 _ (self species new: self length) asStream. for t3 from: self do [t1 = t3  [] t2 next_ t3]. t2 contents] find t1 suchThat t2 | t3 [for t3 to: self length do [t1 value_ self  t3. t2 eval  [t3]]. 0] find: t1 | t2 [for t2 to: self length do [self  t2 = t1  [t2]]. 0] findSorted: t1 | t2 t3 t4 [t4 _ self length + 1. t2 _ 1. while t2 < t4 do [t3 _ t2 + t4 / 2. self  t3 > t1  [t4 _ t3] t2 _ t3 + 1]. t4 - 1] findnon: t1 | t2 [for t2 to: self length do [self  t2  t1  [t2]]. 0] first t1 suchThat t2 | t3 [for t3 to: self length do [t1 value_ self  t3. t2 eval  [self  t3]]. false] frequencies | t1 t2 [t1 _ Dictionary new init: 64. for t2 from: self do [t1 tally: t2]. t1 asInvertedVector sort] grow [self growto: (4 max: self length * 2)] growby: t1 [self growto: self length + t1] growto: t1 [self copy: 1 to: self length to: (self species new: t1)] has: t1 [(self find: t1)  0] hash [self length = 0  [17171] (self  1) hash + (self  self length) hash] insertNonDescending: t1 [self insertSorted: t1] insertSorted: t1 | t2 t3 t4 [t4 _ self findSorted: t1. t2 _ self species new: self length + 1. t3 _ t2 asStream. self  (1 to: t4) copyto: t3. t3 next_ t1. self  (t4 + 1 to: self length) copyto: t3. t2] isArray isIntervalBy1 [false] last [self  self length] last_ t1 [self  self length _ t1] length [user notify: 'message not understood.'] notNil | t1 t2 [t1 _ (self species new: self length - (self count: nil)) asStream. for t2 from: self do [t2  nil  [] t1 next_ t2]. t1 asArray] permutationToSort [(self  (1 to: self length) copy sort: 1 to: self length) map] promote: t1 | t2 [t2 _ self find: t1. t2 = 0  [] self  t2 to: 2 by: 1 _ self  (t2 - 1 to: 1 by: 1). self  1 _ t1] replace: t1 to: t2 by: t3 | t4 t5 [t4 _ self species new: self length + t3 length - (1 + t2 - t1). t5 _ t4 asStream. self copy: 1 to: t1 - 1 to: t5. t3 copy: 1 to: t3 length to: t5. self copy: t2 + 1 to: self length to: t5. t4] reverse [Substring new data: self map: (self length to: 1 by: 1)] sort [self sort: 1 to: self length] sort: t1 to: t2 | t3 t4 t5 t6 t7 t8 t9 t10 [t10 _ t2 + 1 - t1. t10  1  [] t3 _ self  t1. t5 _ self  t2. [t3 > t5  [self swap: t1 with: t2. t6 _ t3. t3 _ t5. t5 _ t6]]. t10 = 2  [] t7 _ t1 + t2 lshift: 1. t4 _ self  t7. [t3 > t4  [self swap: t1 with: t7. t4 _ t3] t5 < t4  [self swap: t2 with: t7. t4 _ t5]]. t10 = 3  [] t8 _ t1. t9 _ t2. while [while [t9 _ t9 - 1. self  t9 > t4] do []. while [t8 _ t8 + 1. self  t8 < t4] do []. t8  t9] do [self swap: t8 with: t9]. self sort: t1 to: t9. self sort: t8 to: t2] species [Vector] subscripts: t1 [Substring new data: t1 map: self] subscripts: t1 _ t2 [self length  t2 length  [user notify: 'lengths not commensurate'] t2 copyto: (Substring new data: t1 map: self). t2] sum [self sumTo: 0] sumTo: t1 | t2 [for t2 from: self do [t1 _ t1 + t2]. t1] swap: t1 with: t2 | t3 [t3 _ self  t1. self  t1 _ self  t2. self  t2 _ t3] transform t1 to t2 | t3 t4 [t3 _ (self species new: self length) asStream. for t4 to: self length do [t1 value_ self  t4. t3 next_ t2 eval]. t3 asArray] viewer [SetReader new of: self] without: t1 | t2 t3 t4 [t1 cansubscript: self  [t2 _ (self species new: self length - 1) asStream. t3 _ self asStream. for t4 to: self length do [t4 = t1  [t3 next] t2 next_ t3 next]. t2 asArray]] Class new title: BitBlt subclassof: Object fields: 'function color destbase destraster destx desty width height sourcebase sourceraster sourcex sourcey clipx clipy clipwidth clipheight sourcefield destfield source dest sstrike dstrike ' declare: 'pageOneCursor ' bltObj: t1 field: t2 to: t3 fromObj: t4 field: t5 [dest _ t1. desty _ t2. source _ t4. sourcey _ t5. desty < 1  [user notify: 'bltObj field spec is 1-origin, like vectors'] clipx _ 0. destx _ clipx. sourcex _ destx. clipwidth _ 16. width _ clipwidth. clipheight _ t3 - desty + 1. height _ clipheight. desty _ desty - 1. clipy _ desty. sourcey _ sourcey - 1. [source  nil  [color _ [NoteTaker  [0] 1]. function _ 12] function _ 0. color _ function]. NoteTaker  [sourcebase _ source. destbase _ dest. [Dorado  [destraster _ 1. sourceraster _ destraster] destraster _ 2. sourceraster _ destraster. destfield _ 1. sourcefield _ destfield]. self callBLT] destraster _ 1. sourceraster _ destraster. destbase _ dest nail. [source  nil  [sourcebase _ destbase] sourcebase _ source nail]. self callBLT. destbase _ dest unNail. source  nil  [] sourcebase _ source unNail] bltrect: t1 topt: t2 mode: t3 color: t4 [function _ t3. color _ t4. destx _ t2 x. desty _ t2 y. t2 _ t1 origin. sourcex _ t2 x. sourcey _ t2 y. t2 _ t1 corner. width _ t2 x - sourcex. height _ t2 y - sourcey. self callBLT] callBLT [user croak] primitive: 40 checksandcall | t1 t2 [NoteTaker  [user notify: 'Not supported on NT'] function _ function land: 15. [destbase class  String  [t1 _ destbase. destbase _ [dstrike  [t1 lock + 9] t1 lock]] destbase  281  [function _ function + 16]]. [sourcebase class  String  [t2 _ sourcebase. sourcebase _ [sstrike  [t2 lock + 9] t2 lock]] sourcebase  281  [function _ function + 32]]. self callBLT. [t1  nil  [] destbase _ t1 unlock]. t2  nil  [] sourcebase _ t2 unlock] classInit [pageOneCursor _ 281] clipTo: t1 [clipx _ t1 minX. clipy _ t1 minY. clipwidth _ t1 width. clipheight _ t1 height] color [color] color_ t1 [color _ t1] copy: t1 [function _ t1 land: 3. self checksandcall] copycomp: t1 [function _ 4 + (t1 land: 3). self checksandcall] destForm_ t1 [dest _ t1. self clipTo: (0  0 rect: dest extent). destraster _ dest width + 15 / 16. destfield _ dest height + 1 / 2 * destraster. destbase _ [NoteTaker  [dest bits] dest bits lock]] dest_ t1 [destx _ t1 x. desty _ t1 y] destbase [destbase] destbase_ t1 [destbase _ t1] destraster [destraster] destraster_ t1 [destraster _ t1] destx [destx] destx_ t1 [destx _ t1] desty [desty] desty_ t1 [desty _ t1] dstrike [dstrike] dstrike_ t1 [dstrike _ t1] extent_ t1 [width _ t1 x. height _ t1 y] fill: t1 color: t2 [color _ t2. function _ 12 + (t1 land: 3). self checksandcall] forCursor [color _ 0. function _ color. sourcebase _ 281. destbase _ sourcebase. height _ 16. width _ height. sourceraster _ 1. destraster _ sourceraster. sourcey _ 0. sourcex _ sourcey. desty _ sourcex. destx _ desty. dstrike _ false. sstrike _ dstrike] fromDisplay [self sourceForm_ DisplayForm] function [function] function_ t1 [function _ t1] height [height] height_ t1 [height _ t1] init [sourcey _ 0. sourcex _ sourcey. height _ sourcex. width _ height. desty _ width. destx _ desty. color _ destx. function _ color. dstrike _ false. sstrike _ dstrike] installForIOP [user croak] primitive: 41 paint: t1 [function _ 8 + (t1 land: 3). self checksandcall] release: t1 [NoteTaker  [dest  DisplayForm  [destbase _ nil. dest _ destbase]] t1 bits unlock] sourceForm_ t1 [source _ t1. sourceraster _ source width + 15 / 16. sourcefield _ source height + 1 / 2 * sourceraster. sourcebase _ [NoteTaker  [source bits] source bits lock]] source_ t1 [sourcex _ t1 x. sourcey _ t1 y] sourcebase [sourcebase] sourcebase_ t1 [sourcebase _ t1] sourceraster [sourceraster] sourceraster_ t1 [sourceraster _ t1] sourcex [sourcex] sourcex_ t1 [sourcex _ t1] sourcey [sourcey] sourcey_ t1 [sourcey _ t1] sstrike [sstrike] sstrike_ t1 [sstrike _ t1] stringCopy: t1 from: t2 to: t3 with: t4 from: t5 to: t6 [width _ 1 + t3 - t2. width = 0  [t1] (t2 > 4096 or t5 > 4096) or width  4096  [false] (width < 0 or width  (1 + t6 - t5)) or ((t2 < 1 or t3 > t1 length) or (t5 < 1 or t6 > t4 length))  [user notify: 'illegal range or subscript'] width _ width * 8. destbase _ t1 lock. destx _ t2 - 1 * 8. sourcebase _ t4 lock. sourcex _ t5 - 1 * 8. self callBLT. t4 unlock. t1  1 _ t1  1. t1 unlock. t1] stringReplace: t1 with: t2 from: t3 to: t4 and: t5 from: t6 to: t7 | t8 [t1 length = 0  [t1] (t4  4096 or t2 length - t4  4096) or (t3 + t7 - t6  4096 or t6 > 4096)  [false] (t3 < 1 or t4 > t2 length) or (t6 < 1 or t7 > t5 length)  [user notify: 'illegal subscript'] destbase _ t1 lock. t8 _ t2 lock. sourcebase _ t8. width _ t3 - 1 * 8. [width = 0  [] destx _ 0. sourcex _ destx. self callBLT]. destx _ width. width _ 1 + t7 - t6 * 8. [width = 0  [] sourcex _ t6 - 1 * 8. sourcebase _ t5 lock. self callBLT. t5 unlock]. destx _ destx + width. width _ t2 length - t4 * 8. [width = 0  [] sourcebase _ t8. sourcex _ t4 * 8. self callBLT]. t1  1 _ t1  1. t2 unlock. t1 unlock. t1] toDisplay [NoteTaker  [self destForm_ DisplayForm. source  nil  [self sourceForm_ DisplayForm]] destbase _ mem  54. destraster _ user screenrect width / 32 * 2] width [width] width_ t1 [width _ t1] window [clipx  clipy rect: clipx + clipwidth  (clipy + clipheight)] window: t1 [NoteTaker  [self clipTo: (t1 intersect: (0  0 rect: dest extent))]] Class new title: BrowseWindow subclassof: PanedWindow fields: '' declare: 'stdTemplates ' classInit [stdTemplates _ (0  0 rect: 10  14) , (10  0 rect: 18  14) , (18  0 rect: 28  14) , (28  0 rect: 36  14) , (0  14 rect: 36  36)] default | t1 t2 t3 t4 t5 [t1 _ SystemPane new. t2 _ ClassPane new. t3 _ OrganizationPane new. t4 _ SelectorPane new. t5 _ CodePane new. self title: 'Classes' with: t1 , t2 , t3 , t4 , t5 at: stdTemplates. self newframe. self show. t1 to: t2. t2 from: t1 to: t3. t3 from: t2 to: t4. t4 from: t3 to: t5. t5 from: t4. t1 update] Class new title: CharLine subclassof: Object fields: 'starti stopi spaces padwidth' declare: '' = t1 [(starti = t1 starti and stopi = t1 stopi) and (spaces = t1 spaces and padwidth = t1 padwidth)] padwidth [padwidth] slide: t1 [starti _ starti + t1. stopi _ stopi + t1] spaces [spaces] starti [starti] starti: t1 stopi: t2 spaces: t3 padwidth: t4 [starti _ t1. stopi _ t2. spaces _ t3. padwidth _ t4] stopi [stopi] stopi_ t1 [stopi _ t1] 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] Class new title: ClassOrganizer subclassof: Object fields: 'globalComment commentVector groupVector' declare: 'default ' asParagraph | t1 t2 [t1 _ Stream default. t1 print: self globalComment. for t2 to: commentVector length do [t1 cr. t1 print: ((commentVector  t2) inVector concat: groupVector  t2)]. t1 contents asParagraph] asStream | t1 t2 [t1 _ Stream new of: (Vector new: 200). for t2 from: groupVector do [t1 append: t2]. t1 contents asStream] categories [commentVector] category: t1 | t2 [t2 _ commentVector find: t1. t2 = 0  [user notify: 'No such category: ' + t1] groupVector  t2] classInit [default _ 'As yet unclassified'] classify: t1 under: t2 | t3 t4 t5 [t1 is: Vector  [for t3 from: t1 do [self classify: t3 under: t2]] t3 _ commentVector find: t2. t3 > 0 and (groupVector  t3 has: t1)  [self] t4 _ self invert: t1. [t4  [t2 = default  [self] t5 _ commentVector find: t4. groupVector  t5 _ groupVector  t5 delete: t1]]. [t3 = 0  [t3 _ self insert: t2]]. groupVector  t3 _ groupVector  t3 insertSorted: t1. t5 _ commentVector find: default. t5 > 0 and (groupVector  t5) length = 0  [self deleteCategory: t5]] delete: t1 | t2 [for t2 to: groupVector length do [groupVector  t2 has: t1  [groupVector  t2 _ groupVector  t2 delete: t1. (groupVector  t2) length = 0 and commentVector  t2 = default  [self deleteCategory: t2]]]] deleteCategory: t1 [groupVector _ groupVector without: t1. commentVector _ commentVector without: t1] fromParagraph: t1 | t2 t3 t4 t5 [user displayoffwhile [t2 _ t1 asVector. self globalComment_ t2  1. commentVector _ Vector new: t2 length - 1. groupVector _ Vector new: t2 length - 1. for t3 to: t2 length - 1 do [t5 _ t2  (t3 + 1). commentVector  t3 _ t5  1. while [t4 _ t5 find: _. 0 = t4  false] do [t5 _ t5 replace: t4 - 1 to: t4 by: (t5  (t4 - 1) + '_') unique inVector]. groupVector  t3 _ (t5 copy: 2 to: t5 length) sort]. nil]] globalComment [globalComment asParagraph text] globalCommentItself [globalComment] globalComment_ t1 [globalComment _ t1] has: t1 | t2 [for t2 from: groupVector do [t2 has: t1  [true]]. false] init: t1 [self globalComment_ 'This class has not yet been commented'. commentVector _ 'As yet unclassified' inVector. groupVector _ t1 inVector] insert: t1 | t2 t3 t4 [t2 _ commentVector find: default. [t2 > 0  [t3 _ groupVector  t2]]. commentVector _ (commentVector without: t2) , t1. groupVector _ (groupVector without: t2) , (Vector new: 0). t4 _ commentVector length. t2 = 0 or t3 length = 0  [t4] commentVector _ commentVector , default. groupVector _ groupVector , t3. t4] invert: t1 | t2 [for t2 to: groupVector length do [groupVector  t2 has: t1  [commentVector  t2]]. false] Class new title: ClassPane subclassof: ListPane fields: 'systemPane organizationPane' declare: 'editmenu ' classInit [editmenu _ Menu new string: 'filout print forget'] close [systemPane _ nil. super close] compile: t1 [systemPane compile: t1] deselected [organizationPane class: nil] dirty [organizationPane dirty] from: t1 to: t2 [systemPane _ t1. organizationPane _ t2] noCode [selection = 0  [systemPane noCode] ''] selected [organizationPane class: Smalltalk  (list  selection)] yellowbug | t1 [selection = 0  [window flash] t1 _ editmenu bug. t1 = 1  [(Smalltalk  (list  selection)) filout] t1 = 2  [(Smalltalk  (list  selection)) printout] t1 = 3  [systemPane forget: list  selection]] Class new title: CodePane subclassof: Window fields: 'pared class selector selectorPane scrollBar' declare: 'editmenu ' class: t1 selector: t2 para: t3 [class _ t1. selector _ t2] classInit [editmenu _ Menu new string: 'again copy cut paste doit compile undo cancel align'] close [pared unselect. pared _ nil. selectorPane _ pared. scrollBar close] compile: t1 [self compile: t1 in: class under: 'As yet unclassified'] compile: t1 in: t2 under: t3 [Generator new compile: t1 in: [class  nil  [t2] class] under: t3 notifying: self] contents [pared contents] dirty [pared formerly  [frame] false] doit | t1 t2 t3 [scrollBar hidewhile [t1 _ pared selectRange. [t1 empty  [pared unselect. pared fintype. pared complement. t1 _ pared selectRange]]. t2 _ selectorPane execute: pared selectionAsStream for: self. [t2  nil or t1  pared selectRange  [nil] t1 _ t1 stop + 1. t3 _ (String new: 100) asStream. t3 space. t3 print: t2. pared Scrap_ t3 contents asParagraph. pared selectRange: (t1 to: t1). pared paste]]] eachtime [user kbck  [self kbd] [frame has: user mp  [[user anybug  [user redbug  [self redbug] user yellowbug  [self yellowbug] user bluebug  [false]]]. user anykeys  [self keyset]]]. self outside] enter [scrollBar show] execute: t1 for: t2 [self execute: t1 in: false to: nil] execute: t1 in: t2 to: t3 [Generator new evaluate: t1 in: t2 to: t3 notifying: self] formerly: t1 [pared formerly: t1] frame_ t1 [frame _ t1. pared  nil  [] pared frame_ frame. scrollBar on: frame from: pared] from: t1 [selectorPane _ t1] hardcopy: t1 [pared hardcopy: t1] init interactive [true] kbd [pared typing] keyset [pared keyset] leave [scrollBar hide] notify: t1 at: t2 in: t3 [pared fintype. pared selectRange: (t2 to: t2). pared replace: ('' + t1 + '.') asParagraph. pared selectAndScroll. false] oldContents [pared formerly] outline [frame outline: 1] outside [scrollBar startup] picked [frame has: user mp] redbug [pared selecting] reflects: t1 [class  nil and t1 > 0] selectRange: t1 [pared selectRange: t1. pared selectAndScroll] show [frame outline. pared show] showing: t1 [pared _ TextImage new para: t1 asParagraph frame: nil. pared formerly: false. pared fixframe: frame. self windowenter. scrollBar _ [scrollBar  nil  [ScrollBar new] scrollBar] on: frame from: pared] windowenter [self outline. pared enter] windowleave [pared  nil  [] pared leave] yellowbug | t1 [t1 _ editmenu bug. t1 = 1  [pared again] t1 = 2  [pared copyselection] t1 = 3  [pared cut] t1 = 4  [pared paste] t1 = 5  [self doit] t1 = 6  [pared formerly  [scrollBar hidewhile [selectorPane compile: pared contents  [pared formerly: false] nil]] frame flash] t1 = 7  [pared undo] t1 = 8  [pared formerly  [self showing: pared formerly] frame flash] t1 = 9  [pared realign]] Class new title: CodeWindow subclassof: PanedWindow fields: '' declare: 'stdTemplates ' class: t1 selector: t2 para: t3 formerly: t4 | t5 [t5 _ CodePane new class: t1 selector: t2 para: nil. self title: t1 title + ' ' + t2 with: t5 inVector at: stdTemplates. self newframe. self show. t5 showing: t3. t5 formerly: t4. t5 from: t5] classInit [stdTemplates _ (0  0 rect: 36  36) inVector] editTitle [titleframe window flash] file: t1 | t2 [t2 _ FilePane new file: t1. self title: t1 name with: t2 inVector at: stdTemplates. self newframe. self show. t2 showing: t1 contents asParagraph. t2 from: t2] Class new title: CompiledMethod subclassof: String fields: '' declare: 'primReturnField primReturnSelf '; bytesize: false; sharing: ByteCodes byte1 [Dorado  [self  1] self  2] byte1: t1 byte2: t2 [Dorado  [self  1 _ t1. self  2 _ t2] self  2 _ t1. self  1 _ t2] byte2 [Dorado  [self  2] self  1] bytes [self isQuick  [''] self  (self startingPC + 1 to: self length)] classInit [primReturnSelf _ 1. primReturnField _ 40] free [self refct > 2  [MethodKeeper next_ self] self freeLiterals] freeKeptMethods | t1 t2 [t1 _ MethodKeeper contents. MethodKeeper _ (Vector new: 10) asStream. for t2 from: t1 do [t2 free]] freeLiterals | t1 t2 t3 t4 [t1 _ self numLiterals. t1 = 0  [] t2 _ Vector new: (t1 max: 2). NoteTaker  [BitBlt new bltObj: t2 field: 1 to: t1 fromObj: self field: 2] t3 _ t2 nail. for t4 to: t1 do [mem  t3 + t4 - 1 _ self word: t4 + 3]. t2 unNail] holdLiterals: t1 | t2 t3 t4 [t2 _ t1 copy. NoteTaker  [BitBlt new bltObj: t2 field: 1 to: t2 length fromObj: nil field: 0] t3 _ t2 nail. for t4 to: t2 length do [mem  t3 + t4 - 1 _ 1]. t2 unNail] init initialPC [self isQuick  [0] NoteTaker  [(self byte1 land: 126) - 1] self  6 + 1] isQuick [NoteTaker  [self byte1 = 128] self length  6] isReturnField [NoteTaker  [self byte1 = 128 and self byte2  255  [self byte2 + 1] false] self  2 = primReturnField  [self  5 + 1] false] isReturnSelf [NoteTaker  [self byte1 = 128 and self byte2 = 255] self  2 = primReturnSelf] literal: t1 [self literals  t1] literals | t1 t2 t3 t4 [t1 _ self numLiterals. t1 = 0  [()] t2 _ Vector new: (t1 max: 2). [NoteTaker  [BitBlt new bltObj: t2 field: 1 to: t1 fromObj: self field: 2. t1 = 1  [t2 _ (t2  1) inVector]] t3 _ t2 nail. for t4 to: t1 do [mem  t3 + t4 - 1 _ self word: t4 + 3]. t2 unNail]. self holdLiterals: t2. t2] messageAt: t1 | t2 [t2 _ self  t1. self  (t1 - 1) = toSendLitLong and t2 < self numLiterals  [self literal: t2 + 1] t2  208  [self literal: t2 - 207] t2  176  [SpecialOops  (t2 - 176 + 10)] nil] numArgs [self isQuick  [0] NoteTaker  [self byte2 land: 15] self  4] numArgs: t1 numTemps: t2 numStack: t3 literals: t4 primitive: t5 bytes: t6 | t7 t8 t9 t10 t11 [t4 _ t4 asVector. [NoteTaker and t5 > 0  [t4 _ t4 , t5 asInteger]]. t7 _ t4 length * 2 + [NoteTaker  [2] 6]. t8 _ CompiledMethod new: t7 + t6 length. t9 _ Stream new of: t8. [NoteTaker  [(t1 > 15 or t2 > 31) or t7  126  [user notify: 'Attempt to create invalid CompiledMethod'. self] t8 byte1: t7 + 2 + (t2 / 16) + [t5 = 0  [0] 128] byte2: t2 \ 16 * 16 + t1]]. t10 _ t1 + t2. t9 next_ 0. t9 next_ t5. t9 next_ t10 + t3. t9 next_ t1. t9 next_ t10. t9 next_ t7. [t4 length > 0  [[NoteTaker  [BitBlt new bltObj: t8 field: 2 to: 1 + t4 length fromObj: t4 field: 1] for t11 to: t4 length do [t8 word: t11 + 3 _ (t4  t11) asOop]]. t8 holdLiterals: t4]]. t9 position_ t7. t6 copyto: t9. t8] numLiterals [self isQuick  [0] NoteTaker  [(self byte1 land: 126) - 4 / 2] self  6 - 6 / 2] numStack [NoteTaker  [0] self length < 6  [0] self  3 - (self  5)] numTemps [self isQuick  [0] NoteTaker  [(self byte1 land: 1) * 16 + (self byte2 / 16)] self  5 - (self  4)] primitive [NoteTaker  [self byte1  128  [0] self literal: self numLiterals] self length < 6  [0] self  2 = 0  [0] self  2] toReturnField: t1 | t2 [[NoteTaker  [t2 _ CompiledMethod new: 2. t2 byte1: 128 byte2: t1 - 1] t2 _ String new: 5. t2  1 _ 0. t2  2 _ primReturnField. t2  3 _ 0. t2  4 _ 0. t2  5 _ t1 - 1]. t2] toReturnSelf | t1 [[NoteTaker  [t1 _ CompiledMethod new: 2. t1 byte1: 128 byte2: 255] t1 _ String new: 2. t1 word: 1 _ primReturnSelf]. t1] Class new title: Cursor subclassof: Object fields: 'bitstr offset' declare: '' asForm [Form new extent: self extent bits: bitstr offset: offset] beAltoCursor [self flipBytes. self mixFields] beNTCursor [self flipBytes. self sepFields] bits [bitstr] extent [16  16] flipBytes | t1 [for t1 to: bitstr length - 1 by: 2 do [bitstr swap: t1 with: t1 + 1]] fromString: t1 [bitstr _ t1. self fromString: bitstr offset: 0  0] fromString: t1 offset: t2 [bitstr _ t1. offset _ t2] frompage1 | t1 [bitstr _ String new: 32. t1 _ BitBlt new. t1 forCursor. t1 sourcebase_ 281. t1 destbase_ bitstr. t1 copy: storing] fromtext: t1 [self fromtext: t1 offset: 0  0] fromtext: t1 offset: t2 | t3 t4 t5 t6 [offset _ t2. bitstr _ String new: 32. t4 _ t1 asStream. t4 next. for t3 to: 16 do [t5 _ 0. while [t6 _ t4 next. t6 = 48 or t6 = 49] do [t5 _ (t5 lshift: 1) + (t6 - 48)]. bitstr word: t3 _ t5]] mixFields | t1 t2 [t2 _ String new: 32. for t1 to: 8 do [t2 word: t1 * 2 - 1 _ bitstr word: t1. t2 word: t1 * 2 _ bitstr word: t1 + 8]. bitstr _ t2] offset [offset] offset: t1 [offset _ t1] printon: t1 | t2 [t1 append: 'Cursor new fromtext: '''. for t2 to: 16 do [t1 cr. (bitstr word: t2) printon: t1 base: 2]. t1 append: ''' offset: '. t1 print: offset. t1 append: '.'] sepFields | t1 t2 [t2 _ String new: 32. for t1 to: 8 do [t2 word: t1 _ bitstr word: t1 * 2 - 1. t2 word: t1 + 8 _ bitstr word: t1 * 2]. bitstr _ t2] show [user currentCursor: self] showwhile t1 | t2 t3 [t2 _ user currentCursor. self show. t3 _ t1 eval. t2 show. t3] topage1 [self show] Class new title: Decompiler subclassof: Object fields: 'method temps instvars literals stack isReference literalNames' declare: 'highlight breakPC '; sharing: ByteCodes block: t1 to: t2 pc t3 hasValue t4 | t5 t6 t7 t8 t9 t10 [t5 _ ParsedBlock default. t3 value_ t2 + 1. t9 _ stack position. t6 _ Stream new of: method from: t1 to: t2. for t7 from: t6 do [t7 < 128  [self loadByte: t7 code: t6] t7 < 136  [self controlByte: t7 code: t6 block: t5] t7 < 140  [self loadByte: t7 code: t6] t7 = 140  [self selectorByte: t7 code: t6 at: t6 position] t7 < 176  [t8 _ self jumpByte: t7 code: t6 block: t5. t6 end  [t3 value_ t8]] self selectorByte: t7 code: t6 at: t6 position]. stack position > t9  [t10 _ stack pop. t4 value_ true. t5 empty and (t10 is: ParsedBlock)  [t10] t5 next_ t10. t5] t4 value_ false. [t5 empty  [t5 next_ nil]]. [t5 returns or (t5  t5 position) returns  [t3 value_ method length + 1]]. t5] checkForRemoteCode: t1 code: t2 block: t3 | t4 t5 t6 t7 t8 [t1 > t2 limit  [false] method  (t1 - 3)  toEnd  [false] t6 _ method  (t1 - 2). t6 < 160 or t6 > 163  [false] t7 _ t6 - 164 * 256 + (method  (t1 - 1)). t1 + t7  (t2 position + 1)  [false] t4 _ stack pop. ((t4 isnt: ParsedMessage) or t4 rcvr  toLoadThisCtxt  false) or (self selector: t4 op)  remoteCopy  [stack next_ t4. false] t8 _ self block: t2 position + 1 to: t1 - 4 pc [t5] hasValue [t5]. stack next_ ParsedRemote new expr: t8. t2 position_ t1 - 1] conditionalJump: t1 code: t2 block: t3 | t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 [t5 _ stack pop. t6 _ self block: t2 position + 1 to: t1 - 1 pc [t8] hasValue [t12]. t8 _ t8 min: t2 limit + 1. t8 < t1  [self loop: t8 whileExpr: t5 doExpr: t6 code: t2 block: t3 doSize: t1 - t2 position - 1. t2 position_ t1 - 1] t7 _ self block: t1 to: t8 - 1 pc [t9] hasValue [t10]. [t9 < t2 position  [t2 position_ t8 - 3. t13 _ true] t2 position_ t8 - 1]. [t8 + 1 = t2 limit and (method  t8  160 and method  t8  167)  [t13 _ true]]. [t8 = t2 limit and (method  t8  144 and method  t8  151)  [t13 _ true]]. t12 and (t6 position = 1 and t6  1  toLoadTrue)  [stack next_ ParsedDisjunct new left: t5 right: [t7 position = 1  [t7  1] t7]] t12 and (t7 position = 1 and t7  1  toLoadFalse)  [stack next_ ParsedConjunct new left: t5 right: [t6 position = 1  [t6  1] t6]] t4 _ ParsedConditional new ifExpr: t5 thenExpr: t6 elseExpr: t7. t12  [t11 _ ParsedBlock default. t11 next_ t4. stack next_ t11] (t2 end or t13  true) or (t8 + 1 = method length and method  t8 = toLoadSelf)  [t3 next_ t4] t11 _ ParsedBlock default. t11 next_ t4. t3 next_ t11] controlByte: t1 code: t2 block: t3 | t4 t5 t6 [t1 = toSmashPop  [t4 _ self makeLoad: t2 next code: t2. t3 next_ ParsedAssignment new var: t4 expr: stack pop] t1 = toSmash  [t2 end  [t6 _ Stream new of: method from: t2 limit + 1 to: method length. t4 _ self makeLoad: t6 next code: t6. t3 next_ ParsedAssignment new var: t4 expr: stack pop] t4 _ self makeLoad: t2 next code: t2. t3 next_ ParsedAssignment new var: t4 expr: stack pop. stack next_ t4] t1 = toPop  [t3 next_ stack pop] t1 = toReturn  [t5 _ stack pop. stack empty  false  [user notify: 'stack not empty'] t5  toLoadSelf and t2 position = method length  [] t3 doesReturn. t3 next_ t5] t1 = toEnd  [user notify: 'unexpected'] t1 = toLoadThisCtxt  [stack next_ t1] t1 = toSuper  [stack pop. stack next_ t1] user notify: 'unknown control byte'] convertMacros: t1 sel: t2 | t3 t4 t5 t6 t7 [t3 _ (Vector new: 10) asStream. t4 _ Vector new: temps length. for t7 to: t2 numArgs do [t4  t7 _ false]. t1 findMacros: t3 compilerTemps: t4. t5 _ t3 contents. for t7 from: t5 length - 1 to: 1 by: 2 do [t5  t7  nil  [] t5  t7 insertMacro: t5  (t7 + 1) decompiler: self]. for t7 to: temps length do [t4  t7  true  [temps  t7 _ '']]] decompile: t1 class: t2 | t3 t4 t5 t6 t7 t8 [method _ t2 method: t1. method length < [NoteTaker  [3] 8]  [self quickCode: t1 class: t2] [NoteTaker  [literals _ method literals. t6 _ method primitive. t7 _ method initialPC - 1. t8 _ method numArgs + method numTemps] literals _ MessageDict new literalsIn: method. t6 _ method  2. t7 _ method  6. t8 _ method  5]. temps _ Vector new: t8. self initSymbols: t2. stack _ (Vector new: 10) asStream. t4 _ self block: t7 + 1 to: method length pc [t5] hasValue [t5]. stack empty  false  [user notify: 'stack not empty'] self convertMacros: t4 sel: t1. t3 _ Stream default. self printPattern: t1 on: t3. t3 crtab: 1. t4 printon: t3 indent: 1 precedence: 0 forValue: false decompiler: self. [t6  0  [t3 append: ' primitive: '. t3 print: t6]]. t3 contents asParagraph makeBoldPattern] findPC: t1 [breakPC _ t1. highlight _ 1 to: 1] highlight [highlight] highlight: t1 [highlight _ t1. highlight] initSymbols: t1 | t2 t3 t4 [for t2 to: temps length do [temps  t2 _ 't' + t2 asString]. instvars _ t1 instvars. literalNames _ Vector new: literals length. t4 _ t1 wholeEnvironment , Smalltalk , Undeclared. for t2 to: literals length do [t3 _ literals  t2. literalNames  t2 _ [t3 is: UniqueString  [t3] t3 is: ObjectReference  [self invertRef: t3 environment: t4] t3  FieldReference  [''] t3 asString]]] instvar: t1 [instvars  (t1 - codeLoadField + 1)] invertRef: t1 environment: t2 | t3 t4 [for t3 from: t2 do [t4 _ t3 invertRef: t1. t4  [t4]]. 'unknown'] jumpByte: t1 code: t2 block: t3 | t4 t5 [t1 < 152  [t1 - 144 + t2 position + 2] t1 < 160  [self conditionalJump: t1 - 152 + t2 position + 2 code: t2 block: t3. t2 position + 1] t1 < 168  [t4 _ t2 next. t5 _ t1 - 164 * 256 + t4 + t2 position + 1. self checkForRemoteCode: t5 code: t2 block: t3. t5] t1 < 172  [t2 skip: 1. user notify: 'conditional jump backward not expected'] t1 < 176  [t4 _ t2 next. self conditionalJump: t1 - 172 * 256 + t4 + t2 position + 1 code: t2 block: t3. t2 position + 1] user notify: 'not a jump byte'] literal: t1 | t2 t3 t4 [t2 _ t1 - codeLoadLit + 1. t3 _ literals  t2. t4 _ literalNames  t2. t3 is: ObjectReference  [t4] (t3 is: UniqueString) or (t3 is: Vector)  ['' + t4] t4] literalIndirect: t1 [literalNames  (t1 - codeLoadLitInd + 1)] loadByte: t1 code: t2 | t3 t4 [t3 _ self makeLoad: t1 code: t2. t3  codeLoadLit and t3 < codeLoadLitInd  [t4 _ literals  (t3 - codeLoadLit + 1). t4  FieldReference  [self remoteReference: t2] t4 is: ObjectReference  [stack next_ ParsedObjectReference new var: t3] stack next_ t3] stack next_ t3] loop: t1 whileExpr: t2 doExpr: t3 code: t4 block: t5 doSize: t6 | t7 t8 t9 [t7 _ t4 position - t6 jmpSize. t8 _ self block: t1 to: t7 pc [t9] hasValue [t9]. t5 skip: 1 - t8 position. t5 next_ ParsedLoop new whileExpr: [t8 position = 1  [t2] t8] doExpr: t3] makeLoad: t1 code: t2 | t3 [t1  136 and t1  139  [t3 _ 256 * (t1 - 135). t2 next + t3] t1 asCompilerCode] printPattern: t1 on: t2 | t3 t4 t5 [t4 _ t1 numArgs. [t4 = 0  [t2 append: t1. t2 space] t5 _ t1 keywords. for t3 to: t5 length do [t2 append: t5  t3. t2 space. t2 append: temps  t3. t2 space]]. t4 = temps length  [] t2 append: '| '. for t3 from: t4 + 1 to: temps length do [t2 append: temps  t3. t2 space]] quickCode: t1 class: t2 | t3 [[NoteTaker  [method isReturnSelf  [t1] t3 _ method isReturnField. [t3  [t1 + ' [' + (t2 instvars  t3) + ']'] 'undecipherable method']] method length = 2  [t1] method length = 5  [t1 + ' [' + (t2 instvars  (method  5 + 1)) + ']'] 'undecipherable method'] asParagraph makeBoldPattern] remoteReference: t1 | t2 t3 t4 t5 [t2 _ stack pop. t4 _ [t2  124  [(0 1 2 10 )  (t2 - 120)] literals  (t2 - codeLoadLit + 1)]. t3 _ stack pop. t1 skip: 2. t5 _ [t3 = toLoadTempframe  [codeLoadTemp + t4 - 1] t3 = toLoadSelf  [codeLoadField + t4 - 1] user notify: 'bad remote reference']. stack next_ ParsedFieldReference new var: t5] selector: t1 [t1 > 166 and t1 < 208  [SpecialOops  (t1 - 166)] literalNames  (t1 - codeSendLit + 1)] selectorByte: t1 code: t2 at: t3 | t4 t5 t6 t7 t8 t9 [t4 _ [t1 = toSendLitLong  [t2 next + codeSendLit] t1 asCompilerCode]. t5 _ self selector: t4. t7 _ t5 numArgs. t9 _ stack pop. [t7 = 0  [t8 _ false] t7 = 1  [t8 _ stack pop] t8 _ Vector new: t7. for t6 from: t7 to: 1 by: 1 do [t8  t6 _ stack pop]]. stack next_ ParsedMessage new rcvr: t9 op: t4 args: t8. t3 = breakPC  [stack last hasPC]] temp: t1 [temps  (t1 - codeLoadTemp + 1)] Class new title: Dictionary subclassof: HashSet fields: 'values' declare: ''  t1 [values  (self findorerror: t1)]  t1 _ t2 [values  self findorerror: t1 _ t2] asInvertedVector | t1 t2 t3 [t1 _ (Vector new: objects length) asStream. for t2 to: objects length do [objects  t2  nil  [] t3 _ Vector new: 2. t3  1 _ values  t2. t3  2 _ objects  t2. t1 next_ t3]. t1 contents] clean | t1 [for t1 from: self do [(self  t1) refct = 1  [self delete: t1]]] copyfrom: t1 [self objects_ t1 objects copy. values _ t1 values copy] delete: t1 [t1 is: Vector  [super delete: t1] values  self findorerror: t1 _ nil. super delete: t1] growto: t1 | t2 t3 [t3 _ self class new init: t1. for t2 from: self do [t3 insert: t2 with: self  t2]. self copyfrom: t3] init: t1 [values _ Vector new: t1. super init: t1] insert: t1 with: t2 [self insert: t1. values  self findorerror: t1 _ t2] insertall: t1 [self insertall: t1 with: (Vector new: t1 length)] insertall: t1 with: t2 | t3 [for t3 to: t1 length do [self insert: t1  t3 with: t2  t3]] invert [self invertto: (Dictionary new init: objects length)] invert: t1 | t2 [for t2 to: values length do [values  t2 = t1  [objects  t2]]. false] invertto: t1 | t2 [for t2 to: objects length do [objects  t2  nil  [] t1 insert: values  t2 with: objects  t2]. t1] lookup: t1 | t2 [t2 _ self find: t1. t2  [values  t2] false] rehash | t1 t2 [t2 _ Dictionary new init: self size. for t1 to: objects length do [objects  t1  nil  [] t2 insert: objects  t1 with: values  t1]. self copyfrom: t2] swap: t1 with: t2 [values swap: t1 with: t2. super swap: t1 with: t2] tally: t1 | t2 [t2 _ self find: t1. t2  [values  t2 _ values  t2 + 1] self insert: t1 with: 1. 1] values [values] with: t1 values: t2 | t3 [for t3 to: t1 length do [self insert: t1  t3 with: t2  t3]] Class new title: Dispframe subclassof: Stream fields: 'text' declare: 'prompt doit ' classInit [prompt _ ''  1. doit _ ' '  1] clear [self reset. self show] eachtime | t1 [text window has: user mp  [user kbck  [t1 _ self kbd. t1  [[t1  nil  [] self space. self print: nil  t1]. self prompt]] user bluebug  [false]] user anybug  [false]] ev | t1 [while [self cr. t1 _ self request: ''. t1] do [self space. self print: nil  t1]. false] firsttime [text window has: user mp  [self outline. self prompt] false] frame [text frame] frame_ t1 [text para: nil frame: t1] init [text _ Textframe new. self of: (String new: 16)] kbd | t1 t2 [while user kbck do [t2 _ user kbd. t2 = 132  [self append: 'done.'. self show. nil] t2 = 8  [self last = prompt  [] self skip: 1] t2 = 30  [t1 _ array  (position to: 1 by: 1) find: prompt. t1 = 0  [self append: 'lost beginning'. self prompt] t2 _ self last: t1 - 1. self next_ doit. self show. t2] t2 = 145  [self last = prompt  [] self skip: 1. while (position > 0 and: self last tokenish) do [self skip: 1]] t2 = 151  [self reset. self prompt] self next_ t2]. self show. false] lasttime [[self last = prompt  [self skip: 2. self show]]. user bluebug  false] leave moveto: t1 [(text window inset: 2  2) dragto: t1 - (2  2)] outline [text window outline: 2] prompt [self cr. self next_ prompt. self show] read | t1 [self next_ prompt. self show. until (user kbck and [t1 _ self kbd. t1]) do []. t1  nil  [false] t1] rect: t1 [self init. self frame_ t1. self clear] request: t1 [self append: t1. self read] show | t1 [text show: self contents asParagraph. until text lastshown  position do [t1 _ text scrolln: 1. position < t1  [] t1 _ array copy: t1 + 1 to: position. text show: t1 asParagraph. position _ 0. self append: t1]] text [text] Class new title: FieldNameCollector subclassof: TokenCollector fields: '' declare: '' identifier: t1 [sink next_ t1] leftparen [self next_ '('] next_ t1 [user notify: 'Invalid field name: ' + t1 asString] rightparen [self next_ ')'] Class new title: FieldReference subclassof: Object fields: 'object offset' declare: '' eval [object instfield: offset] object: t1 offset: t2 [object _ t1. offset _ t2] value [object instfield: offset] value_ t1 [object instfield: offset _ t1. t1] Class new title: Float subclassof: Number fields: '' declare: 'halfpi sqrt2 twopi fourthpi degreesPerRadian pi radiansPerDegree ln2 '; bytesize: true  t1 [self  t1 asFloat] primitive: 4  t1 [self  t1 asFloat] primitive: 7  t1 [self  t1 asFloat] primitive: 5 * t1 [self * t1 asFloat] primitive: 8 + t1 [self + t1 asFloat] - t1 [self - t1 asFloat] primitive: 1 / t1 [0.0 = t1  [user notify: 'Attempt to divide by 0.0'] self / t1 asFloat] primitive: 9 < t1 [self < t1 asFloat] primitive: 2 = t1 [t1 isNumber  [self = t1 asFloat] false] primitive: 6 > t1 [self > t1 asFloat] primitive: 3 \ t1 [self < 0.0  [(self / t1) ipart + 1.0 * t1 + self] self - ((self / t1) ipart * t1)] absprinton: t1 digits: t2 | t3 t4 t5 t6 t7 [t5 _ [self < 1.0  [0 - (10.0 / self epart: 10.0)] self epart: 10.0]. t4 _ self / (10.0 ipow: t5). t3 _ 10.0 ipow: 1 - t2. t4 _ 0.5 * t3 + t4. [t4  10.0  [t4 _ t4 / 10.0. t5 _ t5 + 1]]. [t5 < 6 and t5 > 4  [t6 _ 0. t5 < 0  [t1 append: '0.0000'  (1 to: 1 - t5)]] t6 _ t5. t5 _ 0]. while t4  t3 do [t7 _ t4 asInteger. t1 next_ 48 + t7. t4 _ t4 - t7 * 10.0. t3 _ t3 * 10.0. t5 _ t5 - 1. t5 = 1  [t1 append: '.']]. while t5  1 do [t1 next_ 48. t5 _ t5 - 1. t5 = 1  [t1 append: '.']]. t6  0  [t1 append: 'e'. t1 print: t6]] arctan | t1 t2 t3 t4 t5 [self = 1.0  [45.0] self = 1.0  [45.0] [self * self > 1.0  [t1 _ halfpi. t3 _ 1.0 / (self * self). t2 _ 1.0 / self abs] t1 _ 0.0. t3 _ 0.0 - (self * self). t2 _ self abs]. t5 _ 1. t4 _ 1.0e4. while t2 abs > t4 do [t1 _ t1 + t2. t2 _ t2 * t3 * t5 asFloat / (t5 + 2) asFloat. t5 _ t5 + 2]. t1 _ self sign asFloat * t1 * 360.0 / twopi. t1] asDegrees [self / radiansPerDegree] asDirection [self cos  self sin] asFloat asInteger [(self / 10000.0) asInteger * 10000 + (self \ 10000.0) asInteger] primitive: 33 asLarge | t1 t2 t3 t4 [self < 0  [(0.0 - self) asLarge negated] t2 _ Stream default. [self = 0.0  [t2 next_ 0] t1 _ self ipart. while t1  1 do [t2 next_ (t1 \ 256.0) asInteger. t1 _ t1 / 256.0]]. t2 _ t2 contents. t3 _ Natural new: t2 length. for t4 to: t2 length do [t3  t4 _ t2  t4]. LargeInteger new bytes: t3 neg: false] asRadians [self * radiansPerDegree] classInit [pi _ 3.1415927. halfpi _ pi / 2.0. fourthpi _ pi / 4.0. twopi _ pi * 2.0. radiansPerDegree _ pi / 180.0. degreesPerRadian _ 180.0 / pi. ln2 _ 0.69314718. sqrt2 _ 1.4142136] copy cos [self < 0.0  [(self + halfpi) sin] (halfpi - self) sin] epart: t1 | t2 [self < t1  [0] self < (t1 * t1)  [1] t2 _ 2 * (self epart: t1 * t1). t2 + (self / (t1 ipow: t2) epart: t1)] exp | t1 t2 t3 t4 t5 t6 [self abs > 9212.0  [user notify: 'exp overflow'] t3 _ self / ln2. t2 _ Float new. t2 instfield: 1 _ t3 asInteger * 2. t3 _ t3 fpart. [t3  0.5  [t2 _ t2 * sqrt2. t3 _ t3 - 0.5]]. t4 _ t3 * t3. t6 _ 0.0. t5 _ t6. for t1 from: (28.875564 2525.0429 ) do [t5 _ t5 * t4 + t1]. for t1 from: (1.0 375.02165 7285.7336 ) do [t6 _ t6 * t4 + t1]. t2 * (t6 + (t3 * t5) / (t6 - (t3 * t5)))] fpart [user croak] primitive: 35 ipart [self - self fpart] ipow: t1 [t1 = 0  [1.0] t1 = 1  [self] t1 > 1  [(self * self ipow: t1 / 2) * (self ipow: t1 \ 2)] 1.0 / (self ipow: 0 - t1)] ln | t1 t2 t3 t4 t5 [self  0.0  [user notify: 'ln not valid for ' + self asString] t2 _ self + 0.0. t4 _ ln2 * (((t2 instfield: 1) / 2) asFloat - 0.5). t2 instfield: 1 _ 0. t2 _ t2 * sqrt2. t2 _ t2 - 1.0 / (t2 + 1.0). t3 _ t2 * t2. t5 _ 0.0. for t1 from: (0.23762456 0.28525381 0.40000598 0.66666664 2.0 ) do [t5 _ t5 * t3 + t1]. t4 + (t2 * t5)] log: t1 [self ln / t1 asFloat ln] near: t1 [self near: t1 within: 1.0e4] near: t1 within: t2 [(self - t1) abs  t2] neg [self negated] negated [0.0 - self] printon: t1 [self printon: t1 digits: 8] printon: t1 digits: t2 [self > 0.0  [self absprinton: t1 digits: t2] self = 0.0  [t1 append: '0.0'] t1 append: ''. 0.0 - self absprinton: t1 digits: t2] recopy round [(self + [self < 0  [0.5] 0.5]) asInteger] roundTo: t1 [(self / t1 + [self < 0.0  [0.5] 0.5]) ipart * t1] sameAs: t1 [self = t1] sin | t1 t2 t3 t4 [self < 0.0  [self negated sin negated] self > twopi  [(self \ twopi) sin] self > pi  [(self - pi) sin negated] self > halfpi  [(pi - self) sin] t1 _ self. t3 _ t1. t2 _ t1 * t1. for t4 from: (0.16666667 0.0083333315 1.98409e4 2.7526e6 2.39e8 ) do [t1 _ t1 * t2. t3 _ t4 * t1 + t3]. t3] sqrt | t1 t2 [[self  0.0  [self = 0.0  [0.0] user notify: 'sqrt invalid for x<0.']]. t1 _ self + 0.0. t1 instfield: 1 _ (t1 instfield: 1) / 4 * 2. for t2 to: 5 do [t1 _ self - (t1 * t1) / (t1 * 2.0) + t1]. t1] tan | t1 t2 t3 t4 [self < 0.0  [self negated tan negated] self > pi  [(self \ pi) tan] self > halfpi  [(self - halfpi) tan negated] self > fourthpi  [1.0 / (halfpi - self) tan] t1 _ self. t3 _ t1. t2 _ t1 * t1. for t4 from: (0.3333314 0.1333924 0.05337406 0.024565089 0.002900525 0.0095168091 ) do [t1 _ t1 * t2. t3 _ t4 * t1 + t3]. t3] | t1 [(self / t1) ipart * t1] Class new title: Font subclassof: Object fields: 'name minascii maxascii maxwidth length ascent descent xoffset raster glyphs xtable' declare: '' ALTOformat | t1 t2 t3 t4 [for t1 to: glyphs length - 1 by: 2 do [glyphs swap: t1 with: t1 + 1]. t2 _ glyphs copy. t3 _ glyphs asStream. for t1 to: self height do [t4 _ t1 - 1 + [t1 even  [self height] 0] / 2 * self byteraster + 1. t3 append: t2  (t4 to: t4 + self byteraster - 1)]] NTformat | t1 t2 t3 t4 [for t1 to: glyphs length - 1 by: 2 do [glyphs swap: t1 with: t1 + 1]. t2 _ glyphs copy. t3 _ glyphs asStream. t4 _ 1. for t1 to: self height do [t3 append: t2  (t4 to: t4 + self byteraster - 1). t4 _ t4 + (2 * self byteraster). t4 > t2 length  [t4 _ self byteraster + 1]]] ascent [ascent] byteraster [raster * 2] charForm: t1 [] descent [descent] fromStrike: t1 | t2 t3 [name _ t1. t2 _ dp0 oldFile: name + '.strike.'. t2 nextword. minascii _ t2 nextword. maxascii _ t2 nextword. maxwidth _ t2 nextword. length _ t2 nextword. ascent _ t2 nextword. descent _ t2 nextword. xoffset _ t2 nextword. raster _ t2 nextword. glyphs _ t2 next: self byteraster * self height. xtable _ Vector new: maxascii + 3 all_ 0. for t3 from: (minascii + 1 to: maxascii + 3) do [xtable  t3 _ t2 nextword]] glyphs [glyphs] height [ascent + descent] maxascii [maxascii] maxwidth [maxwidth] minascii [minascii] name [name] raster [raster] spacewidth | t1 [t1 _ self widthof: 32. t1 = 0  [4] t1] widthof: t1 [xtable  (t1 + 2) - (xtable  (t1 + 1))] xtable [xtable] Class new title: FontSet subclassof: Object fields: 'fonts names height ascent descent' declare: ''  t1 [t1 > (fonts length - 1) or t1 < 0  [user notify: 'fontset offset < 0 or > 15 illegal'] fonts  (t1 + 1) Is: Font  [fonts  (t1 + 1)] fonts  1 Is: Font  [fonts  1] user notify: 'No valid fonts in this FontSet']  t1 _ t2 [t1 > (fonts length - 1) or t1 < 0  [user notify: 'fontset offset < 0 or > 15 illegal'] names  t1 + 1 _ t2 name asUppercase. fonts  t1 + 1 _ t2. [ascent < t2 ascent  [ascent _ t2 ascent]]. [descent < t2 descent  [descent _ t2 descent]]. height _ ascent + descent] ascent [ascent] baseline [ascent] descent [descent] family: t1 | t2 t3 [t2 _ Stream default. for t3 from: names  t1 do [t3 isletter  [t2 next_ t3] t2 contents]] height [height] init [fonts _ Vector new: 16. names _ Vector new: 16. descent _ 0. ascent _ descent. height _ ascent] names [names] Class new title: Form subclassof: Object fields: 'extent bits offset figure ground' declare: 'blankcursor brush over dotsetter aurora reverse aurorarunning SPARE black formmenu white color under ' asForm asInstance | t1 [t1 _ Stream new default. t1 nextPoint_ extent. t1 nextPoint_ offset. t1 nextword_ figure. t1 nextword_ ground. t1 nextString_ bits. t1 contents] bits [bits] bits: t1 [bits _ t1] black | t1 [for t1 to: bits length do [bits  t1 _ 0 - 1]] black: t1 [0  0  t1 and t1  extent  [dotsetter destbase_ bits. dotsetter destraster_ extent x + 15 / 16. dotsetter destx_ t1 x. dotsetter desty_ t1 y. dotsetter fill: storing color: black]] close copy | t1 [t1 _ Form new extent: extent. t1 bits: bits copy. t1] displayat: t1 effect: t2 clippedBy: t3 | t4 t5 t6 [t1 is: Point  [t4 _ Rectangle new origin: t1 extent: self extent. t4 bitsFromString: bits mode: t2 clippedBy: t3. aurorarunning  [user displayoffwhile [t6 _ t4 intersect: user screenrect. aurora destination: t6. aurora source: t6. aurora figure: figure. aurora ground: ground. aurora function: 1103. aurora doit. aurora function: 0. aurora doit. nil]]] t1 is: Path  [for t5 to: t1 length do [self displayat: t1  t5 effect: t2 clippedBy: t3]]] extent [extent] extent: t1 [extent _ t1. self extent: extent figure: 0 ground: 1 offset: 0  0] extent: t1 bits: t2 offset: t3 [extent _ t1. bits _ t2. offset _ t3] extent: t1 figure: t2 ground: t3 offset: t4 [extent _ t1. figure _ t2. ground _ t3. offset _ t4. bits _ String new: 2 * extent y * (extent x + 15 / 16)] figure [figure] figure: t1 [figure _ t1] fromImage: t1 [self extent: t1 extent. bits _ t1 rectangle bitsIntoString] fromInstance: t1 [extent _ t1 nextPoint. offset _ t1 nextPoint. figure _ t1 nextword. ground _ t1 nextword. bits _ t1 nextString] fromrectangle: t1 [self extent: t1 extent. bits _ t1 bitsIntoString] fromuser | t1 [t1 _ Rectangle new fromuser. self extent: t1 extent. bits _ t1 bitsIntoString] fromuserevenword | t1 [t1 _ Rectangle new fromuserevenword. self extent: t1 extent. bits _ t1 bitsIntoString] gray | t1 [for t1 to: bits length do [bits  t1 _ 10922]] ground [ground] ground: t1 [ground _ t1] height [extent y] hideData: t1 | t2 t3 [t2 _ String new: 12. t3 _ Stream new. t3 of: t2. t3 nextPoint_ extent. t3 nextPoint_ offset. t3 nextword_ figure. t3 nextword_ ground. t2] length [bits length] offset [offset  nil  [0  0] offset] offset: t1 [offset _ t1] pressCode [5] read: t1 | t2 t3 t4 t5 t6 t7 t8 t9 [t2 _ dp0 file: t1. t4 _ t2 nextword. t5 _ t2 nextword. extent _ t4  t5. t4 * t5 < 64000  [bits _ (Form new extent: extent) bits. t2 into: bits. t2 close] t2 close. user notify: 'too many bits to be a Form'] setfigure: t1 [figure _ figure + 1 \ 14. self displayat: t1 origin effect: 0 clippedBy: user screenrect] setground: t1 [ground _ ground + 1 \ 14. self displayat: t1 origin effect: 0 clippedBy: user screenrect] white | t1 [for t1 to: bits length do [bits  t1 _ 0]] width [extent x] write: t1 | t2 [t2 _ dp0 file: t1. t2 nextword_ self width. t2 nextword_ self height. t2 append: bits. t2 close] Class new title: Generator subclassof: Object fields: 'literals nTemps maxTemp local environment parser supered root requestor sourceStream sourceParagraph' declare: ''; sharing: ByteCodes abortWith: t1 | t2 [[WhatFlag  [user notify: t1]]. NoteTaker  [parser terminate. user restoredisplay. requestor notify: t1 at: sourceStream position in: sourceStream. root eval] t2 _ thisContext swapSender: root sender. root sender_ nil. root _ nil. parser terminate. t2 release. t2 _ nil. user restoredisplay. requestor notify: t1 at: sourceStream position in: sourceStream] assignment: t1 expr: t2 [ParsedAssignment new var: t1 expr: t2] balance [nTemps] block [ParsedBlock default] comment: t1 [] compile: t1 in: t2 under: t3 notifying: t4 | t5 [sourceParagraph _ t1. requestor _ t4. user displayoffwhile [sourceStream _ sourceParagraph asStream. t5 _ self compileIn: t2. [t5  [t2 organization classify: t5 under: t3] nil]]. t5] compileIn: t1 | t2 t3 t4 t5 t6 [[NoteTaker  [self setRoot [nil]] root _ thisContext]. parser _ Parser new. parser from: sourceStream to: self. self initSymbols: t1. t2 _ ParsedBlock default. t5 _ parser pattern: t2. t4 _ nTemps. parser temporaries: t2. t6 _ parser body: t2. parser mustBeDone. parser _ nil. t2 mustReturn: true. t3 _ (t6 = 0 and t4 = 0) and t2 quickCode. [t3  [] t3 _ self generate: t2 in: t1 prim: t6 nargs: t4]. t1 install: t5 method: t3 literals: literals code: sourceStream asArray backpointers: nil. [HuhFlag  [Huh _ nil. Huh _ (self decompile: t3 onto: Stream default) contents. HuhFlag _ false]]. t5] contents declaration: t1 name: t2 asArg: t3 | t4 t5 [t5 _ self newTemp. t4 _ local lookup: t2. t4  [t3 and t4 isField  [t1 next_ ParsedAssignment new var: t4 expr: t5] parser notify: 'NAME ALREADY IN USE'] local insert: t2 with: t5] decompile: t1 onto: t2 [t1 length < 6  [t2 append: 'Quick code: '. t2 append: t1 asBytes. t2] t2 print: t1  4. t2 append: ' args; '. t2 print: t1  5. t2 append: ' temps; '. t2 print: t1  3 - (t1  5). t2 append: ' stack; '. t2 print: t1  6 - 6 / 2. t2 append: ' literals; '. [t1  2 > 0  [t2 append: ' primitive: '. t2 print: t1  2. t2 append: ';']]. t2 print: t1 length. t2 append: ' bytes total.'. t2 cr. t1  2 = 40  [t2] self decompileBytes: t1 onto: t2] decompileBytes: t1 onto: t2 | t3 t4 t5 t6 t7 t8 [t3 _ Dictionary new init: 64. t3 insertall: ((128 to: 131) copy , 125 concat: (144 to: 175) copy) with: ('_^' '_' '^' '' 'end' 'jmp1' 'jmp2' 'jmp3 ' 'jmp4' 'jmp5' 'jmp6' 'jmp7' 'jmp8' 'bfp1' 'bfp2' 'bfp3 ' 'bfp4' 'bfp5' 'bfp6' 'bfp7' 'bfp8' 'jmp' 'jmp' 'jmp' 'jmp' 'jmp' 'jmp' 'jmp' 'jmp' 'bfp' 'bfp' 'bfp' 'bfp' 'bfp' 'bfp' 'bfp' 'bfp' ). for t4 from: local contents do [t5 _ local  t4. t8 _ t5 land: 255. [t5 > 255 and t8 < 16  [t5 _ ((t5 lshift: 8) - 1 lshift: 4) + t8]]. t3 insert: t5 with: t4]. for t4 from: stdSelectors contents do [t3 insert: stdSelectors  t4 with: [t4 is: Integer  [t4 inString] t4]]. for t5 to: 5 do [t3 insert: toLoadConst + t5 - 1 with: ('1' '0' '1' '2' '10' )  t5]. t7 _ (t1  (t1  6 + 1 to: t1 length)) asStream. for t8 from: t7 do [[t8  toLoadFieldLong and t8  toSendLitLong  [t8 _ (t8 - 135 lshift: 8) + t7 next]]. t6 _ t3 lookup: t8. [t6  [t2 append: t6] t2 append: '#'. t2 append: t8 base8]. t2 space. t8 < toLongJmp  [] t8  176  [] t2 print: t8 \ 8 - 4 * 256 + t7 next. t2 space]. t2 cr. t2] encodeSel: t1 | t2 [t2 _ stdSelectors lookup: t1. t2  [t2] codeSendLit + (self litIndex: [t1 class  Integer  [UST1  (t1 + 1)] t1 unique])] evalKeyword: t1 [t1] evaluate: t1 in: t2 to: t3 notifying: t4 | t5 t6 t7 t8 [sourceStream _ t1. requestor _ t4. t5 _ user displayoffwhile [self evaluateIn: t2 to: t3]. root  true  false  [t5] t6 _ nTemps. NoteTaker  [t2  [t5 run: t3 in: t2 mclass] t5 run: t3 in: t3 class] t2  [t8 _ t2 tempframe  (1 to: t6) copyto: (Vector new: t5  3). t7 _ t2 interpret: t5 with: t8. t8  (1 to: t6) copyto: t2 tempframe. t7] Context new have: t3 interpret: t5] evaluateIn: t1 to: t2 | t3 t4 t5 t6 [[NoteTaker  [self setRoot [nil]] root _ thisContext]. t3 _ ParsedBlock default. parser _ Parser new. parser from: sourceStream to: self. [t1  [t5 _ t1 mclass. self initSymbols: t5. t1 variableNamesInto: self with: ParsedBlock default. t6 _ nTemps. NoteTaker  [self setRoot [nil]] root _ thisContext] t5 _ t2 class. self initSymbols: t5]. parser temporaries: t3. parser statements: t3. parser mustBeDone. parser _ nil. t3 mustReturn: false. t4 _ self generate: t3 in: t5 prim: 0 nargs: 0. [HuhFlag  [Huh _ nil. Huh _ (self decompile: t4 onto: Stream default) contents. HuhFlag _ false]]. root _ true. nTemps _ t6. t4] for: t1 from: t2 to: t3 do: t4 on: t5 | t6 [t6 _ self newTempForMacro. t5 next_ ParsedAssignment new var: t6 expr: t3. t5 next_ ParsedAssignment new var: t1 expr: t2. t5 next_ ParsedLoop new whileExpr: (ParsedMessage new rcvr: t6 op: toGeq args: (ParsedAssignment new var: t1 expr: (ParsedMessage new rcvr: toLoad1 op: toPlus args: t1))) doExpr: t4] forfromdo: t1 args: t2 | t3 t4 t5 t6 [t3 _ (t2  1) local. t4 _ t2  2. t5 _ (t2  3) local. t6 _ self newTempForMacro. t1 next_ ParsedAssignment new var: t6 expr: (ParsedMessage new rcvr: t4 op: toAsStream args: false). t1 next_ ParsedLoop new whileExpr: (ParsedAssignment new var: t3 expr: (ParsedMessage new rcvr: t6 op: toNext args: false)) doExpr: t5] forfromtobydo: t1 args: t2 [t2  2 _ self rcvr: t2  2 selector: 'to:by:' args: (t2  (3 to: 4)) copy. self forfromdo: t1 args: (t2  (1 2 5 )) copy] forfromtodo: t1 args: t2 [self for: (t2  1) local from: (ParsedMessage new rcvr: t2  2 op: toMinus args: toLoad1) to: t2  3 do: (t2  4) local on: t1] fortodo: t1 args: t2 [self for: (t2  1) local from: toLoad0 to: t2  2 do: (t2  3) local on: t1] generate: t1 in: t2 prim: t3 nargs: t4 | t5 t6 t7 t8 t9 t10 [t7 _ literals find: nil. [t7 > 0  [literals _ (literals  (1 to: t7 - 1)) copy]]. [NoteTaker  [] supered  [literals _ literals , (Smalltalk ref: t2 title unique)]]. t5 _ String new: t1 sizeForValue. t6 _ t5 asStream. t8 _ ParseStack init. t1 emitForValue: t6 on: t8. [t8 position  1  [user notify: 'Compiler stack discrepancy']]. [t6 position  t5 length  [user notify: 'Compiler code size discrepancy']]. t9 _ maxTemp - t4. [NoteTaker  [t4 > 15 or t9 > 31  [user notify: 'Methods are limited to 15 args and 31 temps']]]. t10 _ (CompiledMethod new: 2) numArgs: t4 numTemps: t9 numStack: t8 length literals: literals primitive: t3 bytes: t5. NoteTaker  [t10] t10 freeLiterals. t5 _ String new: t10 length. t10 copyto: t5 asStream. t5] identifier: t1 [nTemps _ nTemps + 1. local insert: t1 with: nTemps] ifExpr: t1 thenExpr: t2 elseExpr: t3 [ParsedConditional new ifExpr: t1 thenExpr: t2 elseExpr: t3] ifthen: t1 args: t2 [t1 next_ self ifExpr: (t2  1) local thenExpr: (t2  2) local elseExpr: (self nullStatement: ParsedBlock default)] ifthenelse: t1 args: t2 [t1 next_ self ifExpr: (t2  1) local thenExpr: (t2  2) local elseExpr: (t2  3) local] initSymbols: t1 | t2 [environment _ t1 wholeEnvironment , Smalltalk. local _ Dictionary new copyfrom: stdPrimaries. nTemps _ codeLoadField - 1. for t2 from: t1 instvars do [nTemps _ nTemps + 1. local insert: t2 with: nTemps]. maxTemp _ 0. nTemps _ maxTemp. literals _ Vector new: 123. supered _ false] juggle | t1 [t1 _ maxTemp. maxTemp _ nTemps. t1] keywordMessage: t1 selector: t2 args: t3 [t2 = 'and'  [ParsedConjunct new left: t1 right: t3 local] t2 = 'or'  [ParsedDisjunct new left: t1 right: t3 local] self rcvr: t1 selector: t2 args: (t3 remote: self)] litIndex: t1 | t2 t3 [for t2 to: 123 do [t3 _ literals  t2. t3  nil  [literals  t2 _ t1. t2 - 1] t3 class  t1 class  [t3 sameAs: t1  [t2 - 1]]]. parser notify: 'MORE THAN 123 LITERALS REFERENCED'] literal: t1 | t2 [[t1 class  Integer  [t2 _ (1 0 1 2 10 ) find: t1. 0  t2  [toLoadConst + t2 - 1]]]. codeLoadLit + (self litIndex: t1)] macro: t1 selector: t2 args: t3 | t4 [t4 _ inLineMsgs lookup: t2. t4  [self perform: t4 with: t1 with: t3] Context canunderstand: t2 unique  [t1 next_ self rcvr: toLoadThisCtxt selector: t2 args: (t3 remote: self)] false] newTemp [nTemps _ nTemps + 1. nTemps > maxTemp and [maxTemp _ nTemps. maxTemp > 256]  [parser notify: 'MORE THAN 256 TEMPS REQUIRED'] codeLoadTemp + nTemps - 1] newTempForMacro [nTemps _ maxTemp. self newTemp] noEvalKeyword: t1 [t1 asRemoteCode: self] notify: t1 [parser notify: t1] nullStatement: t1 [t1 next_ toLoadNil. t1] rcvr: t1 selector: t2 args: t3 [[t1  toSuper  [supered _ true]]. ParsedMessage new rcvr: t1 op: (self encodeSel: t2) args: t3] receivingVar: t1 | t2 t3 [t2 _ t1 emittedReceiver. t2  [t3 _ t2 emittedVariable. t3  [t3] t3 _ self newTemp. t1 emittedReceiver_ ParsedAssignment new var: t3 expr: t2. t3] parser notify: 'MAY ONLY FOLLOW A MESSAGE'] separator: t1 [] setRoot t1 [root _ t1] terminate [NoteTaker  [] root _ nil] trailer: t1 [] unbalance: t1 [nTemps _ t1] unjuggle: t1 [maxTemp _ t1 max: maxTemp] untildo: t1 args: t2 [t1 next_ ParsedLoop new whileExpr: (ParsedNegation new rcvr: (t2  1) local op: toEq args: toLoadFalse) doExpr: (t2  2) local] variable: t1 | t2 t3 t4 t5 [t2 _ local lookup: t1. t2  [t2] t5 _ t1 hasBeenUniqued. [t5  [for t3 from: environment do [t4 _ t3 lookupRef: t5. t4  [codeLoadLitInd + (self litIndex: t4)]]]]. requestor interactive  [parser notify: 'Smalltalk declare: ' + t1 + ' as: nilTO DECLARE GLOBAL'] user show: ' (' + t1 + ' is Undeclared) '. t5 _ t1 unique. Undeclared declare: t5. codeLoadLitInd + (self litIndex: (Undeclared ref: t5))] whiledo: t1 args: t2 [t1 next_ ParsedLoop new whileExpr: (t2  1) local doExpr: (t2  2) local] Class new title: HashSet subclassof: Object fields: 'objects' declare: '' asStream [self contents asStream] contents | t1 t2 [t2 _ (Vector new: objects length) asStream. for t1 from: objects do [t1  nil  [] t2 next_ t1]. t2 contents] copy [self class new copyfrom: self] copyfrom: t1 [objects _ t1 objects copy] delete: t1 | t2 t3 t4 [t1 is: Vector  [for t2 from: t1 do [self delete: t2]] t2 _ self findorerror: t1. objects  t2 _ nil. t4 _ objects length. while [t2 _ [t2 = t4  [1] t2 + 1]. objects  t2  nil  false] do [t3 _ self findornil: objects  t2. t2 = t3  [] self swap: t2 with: t3]] find: t1 | t2 [t2 _ self findornil: t1. objects  t2 = t1  [t2] false] findorerror: t1 | t2 [t2 _ self findornil: t1. objects  t2 = t1  [t2] user notify: t1 asString + ' cannot be found'. t2] findorinsert: t1 | t2 [t2 _ self findornil: t1. objects  t2 = t1  [t2] self sparse  [objects  t2 _ t1. t2] self growto: objects length * 2. self findorinsert: t1] findornil: t1 | t2 t3 [t3 _ t1 hash \ objects length. for t2 to: objects length do [t3 _ [t3 = objects length  [1] t3 + 1]. objects  t3  nil  [t3] objects  t3 = t1  [t3]]. 1] growto: t1 | t2 t3 [t2 _ self class new init: t1. [t1 < objects length  [for t3 from: self do [t2 insert: t3]] for t3 from: self do [t2 rawinsert: t3]]. objects _ t2 objects] has: t1 [objects  (self findornil: t1) = t1] init [self init: 4] init: t1 [objects _ Vector new: (t1 max: 2)] insert: t1 | t2 [self findorinsert: t1. t1] insertall: t1 | t2 [for t2 from: t1 do [self insert: t2]] objects [objects] objects_ t1 [objects _ t1] packprobes | t1 t2 t3 t4 t5 t6 [t2 _ 0. t1 _ t2. t3 _ objects length. for t4 to: t3 do [t5 _ objects  t4. t5  nil  [] t6 _ t5 hash \ t3. t1 _ t1 + [t4 < t6  [t3 - t6 + t4] t4 - t6]. t2 _ t2 + 1]. t2 = 0  [1 , 1] t2 asFloat / t3 , (t1 asFloat / t2)] rawinsert: t1 | t2 [t2 _ self findornil: t1. objects  t2 _ t1. t2] rehash | t1 t2 [t2 _ HashSet new init: self size. for t1 to: objects length do [objects  t1  nil  [] t2 insert: objects  t1]. objects _ t2 objects] shrink | t1 t2 [t2 _ self. t1 _ t2 growto: (2 max: t2 size / 2). until t1 size = t2 size do [(t2 size - t1 size) print. user show: ' '. t2 _ t1. t1 _ t2 growto: (2 max: t2 size / 2)]. t1] size [objects length] sparse | t1 t2 [t2 _ objects length. for t1 to: objects length do [objects  t1  nil  [t2 _ t2 - 8. t2  0  [true]]]. false] swap: t1 with: t2 [objects swap: t1 with: t2] Class new title: Integer subclassof: Number fields: '' declare: 'digitbuffer '; bytesize: true; sharing: BitMasks; sharing: ByteCodes  t1 | t2 [t2 _ t1 asInteger. t2 isLarge  [t2 neg  false] self  t2]  t1 | t2 [t1 = 1  [self < 0  [((self land: 255) lxor: 255) + 1 land: 255] self land: 255] [t1 = 2  [self < 0  [t2 _ (self lshift: 8) lxor: 255. (self land: 255) = 0  [t2 + 1 land: 255] t2] self lshift: 8]]. 0]  t1 | t2 [t1 isNumber  [t2 _ t1 asInteger. t2 isLarge  [true] self  t2] true]  t1 | t2 [t2 _ t1 asInteger. t2 isLarge  [t2 neg] self  t2] * t1 | t2 [t1 is: Integer  [self asLarge * t1] t2 _ t1 asInteger. t2 isLarge  [self asLarge * t1] self * t2] primitive: 8 + t1 | t2 [t1 is: Integer  [self asLarge + t1] t2 _ t1 asInteger. t2 isLarge  [self asLarge + t1] self + t2] - t1 | t2 [t1 is: Integer  [self asLarge - t1] t2 _ t1 asInteger. t2 isLarge  [self asLarge - t1] self - t2] / t1 [0 = t1  [user notify: 'Attempt to divide by 0'] t1 isLarge  [self asLarge / t1] self / t1 asInteger] primitive: 9 < t1 | t2 [t2 _ t1 asInteger. t2 isLarge  [t2 neg  false] self < t2] = t1 | t2 [t1 isNumber  [t2 _ t1 asInteger. t2 isLarge  [false] self = t2] false] > t1 | t2 [t2 _ t1 asInteger. t2 isLarge  [t2 neg] self > t2] \ t1 [0 = t1  [user notify: 'Attempt to divide by 0'] t1 isLarge  [self asLarge \ t1] self \ t1 asInteger] primitive: 10 absprinton: t1 | t2 [t2 _ self \ 10. [self > 9  [self / 10 absprinton: t1]]. t1 next_ t2 + 48] allmask: t1 [t1 = (self land: t1)] anymask: t1 [0  (self land: t1)] asCompilerCode [self < 16  [self + codeLoadField] self < 32  [self - 16 + codeLoadTemp] self < 64  [self - 32 + codeLoadLit] self < 111  [self - 64 + codeLoadLitInd] self < 208  [self] self < 256  [self - 208 + codeSendLit] user notify: 'unexpected byte'] asFloat [user croak] primitive: 32 asInt16 asInt32 [Int32 new high: 0 low: self] asInteger asLarge | t1 t2 [t1 _ self bytes. t2 _ Natural new: t1 length. t2  1 _ t1  1. [t2 length = 2  [t2  2 _ t1  2]]. LargeInteger new bytes: t2 neg: self neg] asLowercase [65  self  [self  90  [self + 32]]] asNatural | t1 [t1 _ Natural new: self length. t1  1 _ self  1. [t1 length > 1  [t1  2 _ self  2]]. t1] asObject [user croak] primitive: 37 asSmall asUppercase [97  self  [self  122  [self - 32]]] between: t1 and: t2 [self  t1 and self  t2] bfpSize [[self < 0  [2] self > 8  [2] 1]] bits: t1 [self bits: t1 start to: t1 stop] bits: t1 to: t2 | t3 t4 [t3 _ t2 - t1 + 1. t4 _ [t3 < 15  [biton  (t3 + 1) - 1] t3 = 15  [32767] 1]. (self lshift: t2 - 15) land: t4] bits: t1 to: t2 _ t3 | t4 t5 [t4 _ t2 - t1 + 1. t5 _ [t4 < 15  [biton  (t4 + 1) - 1] t4 = 15  [32767] 1]. (self land: ((t5 lshift: 15 - t2) lxor: 1)) lor: ((t3 land: t5) lshift: 15 - t2)] bytes cansubscript: t1 [self  1 and self  t1 length] classInit [digitbuffer _ String new: 16] compare: t1 | t2 t3 t4 [t3 _ self length. t3 > t1 length  [3] t3 < t1 length  [1] for t2 from: self length to: 1 by: 1 do [t4 _ self  t2. t4 > (t1  t2)  [3] t4 < (t1  t2)  [1]]. 2] compareChar: t1 | t2 [t2 _ self. [65  t2  [t2  90  [t2 _ t2 + 32]]]. [65  t1  [t1  90  [t1 _ t1 + 32]]]. t2 < t1  [1] t2 = t1  [2] 3] copy emitBfp: t1 on: t2 [t2 pop: 1. 0 = self  [t1 next_ toPop] 1  self and self  8  [t1 next_ self + toShortBfp - 1] t1 emitLong: toLongBfp by: self] emitBytes: t1 | t2 t3 [self < 256  [t1 next_ self] t2 _ self lshift: 8. t3 _ self land: 255. (16 16 32 48 48 )  t2 > t3  [t1 next_ (0 16 32 64 208 )  t2 + t3] t1 next_ toLoadFieldLong + t2 - 1. t1 next_ t3] emitForValue: t1 on: t2 [[self = toSuper  [t1 next_ toLoadSelf] self emitBytes: t1]. t2 push: 1] emitJmp: t1 on: t2 [0 = self  [] 1  self and self  8  [t1 next_ self + toShortJmp - 1] t1 emitLong: toLongJmp by: self] emitsLoad [self < 256  [self < toSmashPop] self < codeSendLit] emittedVariable [[self < 256  [self  toSuper] self < codeSendLit]  [] false] even [(self land: 1) = 0] field: t1 | t2 [t2 _ 15 - (t1 land: 15). self bits: t2 - (t1 / 16) + 1 to: t2] field: t1 _ t2 | t3 [t3 _ 15 - (t1 land: 15). self bits: t3 - (t1 / 16) + 1 to: t3 _ t2] findMacros: t1 compilerTemps: t2 | t3 t4 t5 [self < codeLoadTemp or self > (codeLoadTemp + 255)  [] t4 _ self - codeLoadTemp + 1. t2  t4  false  [] t2  t4  nil  [t2  t4 _ false] for t3 from: t1 position to: 2 by: 2 do [t5 _ t1  (t3 - 1)  (t1  t3). t5 var = self  [t1  t3 _ nil. t1  t3 - 1 _ nil. t2  t4 _ false. nil]]. user notify: 'couldnt find bad macro'] firstPush hash hex4 [self base: 16] hibit | t1 [for t1 to: 16 do [(self land: biton  (17 - t1))  0  [17 - t1]]. 0] inString | t1 [t1 _ String new: 1. t1  1 _ self. t1] instfield: t1 [t1 = 1  [self] user notify: 'arg too big'] intdiv: t1 [t1 is: Integer  [self / t1 , (self \ t1)] t1 is: LargeInteger  [self asLarge intdiv: t1] user notify: 'I give up'] isField [self  codeLoadField and self < codeLoadTemp] isInt isalphanumeric [self isletter  [true] self isdigit] isdigit [self  48  [self  57] false] isletter [self  97  [self  122] self  65  [self  90] false] jmpSize [[self = 0  [0] self < 0  [2] self > 8  [2] 1]] land: t1 [t1 land: self] primitive: 14 last [self  self length] length [self  256 or self  256  [2] 1] lor: t1 [t1 lor: self] primitive: 15 lshift: t1 [NoteTaker and t1 class  Integer  [self asLarge lshift: t1] self lshift: t1 asSmall] primitive: 12 lxor: t1 [t1 lxor: self] primitive: 13 maxVal [NoteTaker  [16383] 32767] minVal [NoteTaker  [16384] 32768] natcompare: t1 | t2 t3 t4 [t3 _ self length. t3 > t1 length  [3] t3 < t1 length  [1] for t2 from: self length to: 1 by: 1 do [t4 _ self  t2. t4 > (t1  t2)  [3] t4 < (t1  t2)  [1]]. 2] natnormalize: t1 | t2 t3 t4 t5 t6 [t4 _ Natural new: self length + 1. t2 _ 0. t5 _ t1 - 8. for t3 to: t4 length do [t6 _ self  t3. t4  t3 _ ((t6 lshift: t1) lor: t2) land: 255. t2 _ t6 lshift: t5]. t4] neg [self < 0  [true] false] negate [0 - self] negated [0 - self] nomask: t1 [0 = (self land: t1)] oneToMeAsStream [Stream new of: (Interval new from: 1 to: self by: 1)] printon: t1 [self < 0  [self = self minVal  [t1 append: [NoteTaker  ['16384'] '32768']] t1 append: ''. 0 - self printon: t1 base: 10] self printon: t1 base: 10] printon: t1 base: t2 | t3 t4 t5 [t5 _ self. [t5 < 0  [t3 _ 1. digitbuffer  1 _ 16384 \ t2 * 2 + self - 32768 \ t2. t5 _ 16384 / t2 * 2 + (self - 32768 / t2)] t3 _ 0]. while t5  t2 do [t3 _ t3 + 1. digitbuffer  t3 _ t5 \ t2. t5 _ t5 / t2]. t3 _ t3 + 1. digitbuffer  t3 _ t5. for t4 to: t3 do [t5 _ digitbuffer  t3. t1 next_ [t5 < 10  [48 + t5] 55 + t5]. t3 _ t3 - 1]] printon: t1 indent: t2 precedence: t3 forValue: t4 decompiler: t5 [t4  false  [] self < 112  [user notify: 'unknown code'] self < 128  [t1 append: ('sender' 'self' '?' '?' '?' '?' '?' '?' '1' '0' '1' '2' '10' 'nil' 'false' 'true' )  (self - 111)] self = 133  [t1 append: 'thisContext'] self = 134  [t1 append: 'super'] self < 167  [user notify: 'unknown code'] self < 208  [t1 append: SpecialOops  (self - 166)] self < 256  [user notify: 'unknown code'] self < 512  [t1 append: (t5 instvar: self)] self < 768  [t1 append: (t5 temp: self)] self < 1024  [t1 append: (t5 literal: self)] self < 1280  [t1 append: (t5 literalIndirect: self)] t1 append: (t5 selector: self)] purge [user croak] primitive: 54 recopy sameAs: t1 [self = t1] sizeForValue [self < 256 or (16 16 32 48 48 )  (self lshift: 8) > (self land: 127)  [1] 2] subscripts: t1 [self cansubscript: t1  [t1  self] user notify: 'Subscript out of bounds: ' + self asString] subscripts: t1 _ t2 | t3 [self cansubscript: t1  [t3 _ t2 asInteger. (t1 is: String) and (t3 isnt: Integer)  [user notify: 'Improper store (non-char into String?)'] t1  self _ t3] user notify: 'Subscript out of bounds: ' + self asString] time [] primitive: 71 time t1 | t2 [t2 _ self time. t1 eval. self time - t2] tokenish [self isletter  [true] self isdigit  [true] '.:' has: self] unsigned [self < 0  [65536.0 + self asFloat] self asFloat] unsignedadd: t1 [self + t1 land: 255] unsignedlessthan: t1 [self < t1] | t1 [self / t1 * t1] Class new title: Interval subclassof: Array fields: 'start stop step length' declare: ''  t1 [[t1 is: Integer  [t1 < 1  [nil] t1 > length  [nil] start + (step * (t1 - 1))]]. super  t1]  t1 _ t2 [user notify: 'Intervals are not for writing into'] = t1 [start = t1 start and (stop = t1 stop and length = t1 length)] cansubscript: t1 [length  0 or ((start cansubscript: t1) and (length - 1 * step + start cansubscript: t1))] from: t1 to: t2 by: t3 [start _ t1. stop _ t2. step _ t3. length _ 1 + (stop - start / step). step < 0  [start < stop  [length _ 0]] stop < start  [length _ 0]] isIntervalBy1 [step = 1] length [length] random [step _ (13849 + (27181 * step)) asInt16. (start + (length asFloat * (32768.0 + step) / 65536.0)) asSmall] randomInit [self randomInit: mem  280] randomInit: t1 [step _ t1. start is: Float  [length _ stop - start]] start [start] stop [stop] Class new title: LargeInteger subclassof: Number fields: 'bytes "A Natural number (digits are 0 to 255)" neg "The sign" ' declare: ''; sharing: BitMasks  t1 [(self compare: t1) < 3  [self] false]  t1 [(self compare: t1) > 1  [self] false] * t1 | t2 t3 [t2 _ t1 neg. t3 _ bytes nattimes: t1 bytes. LargeInteger new bytes: t3 neg: neg  t2  false] + t1 | t2 t3 [t2 _ t1 neg. neg  t2  [t3 _ bytes natadd: t1 bytes. LargeInteger new bytes: t3 neg: neg] t3 _ bytes natsubtract: t1 bytes. neg  [t3 negate] t3] - t1 | t2 t3 [t2 _ t1 neg. neg  t2  [t3 _ bytes natsubtract: t1 bytes. neg  [t3 neg_ t3 neg  false] t3] t3 _ bytes natadd: t1 bytes. LargeInteger new bytes: t3 neg: neg] / t1 [((self intdiv: t1)  1) asInteger] < t1 [(self compare: t1) = 1  [self] false] = t1 [t1 isNumber  [(self compare: t1) = 2  [self] false] false] > t1 [(self compare: t1) = 3  [self] false] \ t1 [(self intdiv: t1)  2] abs [LargeInteger new bytes: bytes neg: false] allmask: t1 [t1 = (self land: t1)] anymask: t1 [0  (self land: t1)] asFloat [self asString asFloat] asInt16 | t1 [t1 _ bytes  1. [bytes length > 1  [t1 _ (bytes  2 lshift: 8) + t1]]. neg  [t1 = 0 minVal  [t1] 0 - t1] t1] asInteger [self canBeSmall  [self asSmall] self] asLarge asSmall | t1 t2 [t1 _ bytes  1. [bytes length > 1  [t2 _ bytes  2. t1 _ ([NoteTaker  [(t2 land: 63) - (t2 land: 64)] t2] lshift: 8) + t1]]. neg  [t1 = 0 minVal  [t1] 0 - t1] t1] bit: t1 | t2 [t2 _ bytes  (1 + (t1 - 1 / 8)). (t2 lshift: 0 - (t1 - 1 \ 8)) land: 1] bits: t1 to: t2 | t3 t4 [t3 _ t2 - t1 + 1. t4 _ [t3 < 15  [biton  (t3 + 1) - 1] t3 = 15  [32767] 1]. (self lshift: t2 - 15) land: t4] bits: t1 to: t2 _ t3 | t4 t5 [t4 _ t2 - t1 + 1. t5 _ [t4 < 15  [biton  (t4 + 1) - 1] t4 = 15  [32767] 1]. (self land: ((t5 lshift: 15 - t2) lxor: 1)) lor: ((t3 land: t5) lshift: 15 - t2)] bytes [bytes] bytes: t1 neg: t2 [bytes _ t1. neg _ t2. while bytes isLarge do [bytes _ bytes bytes]] canBeInt16 | t1 [[bytes length > 2  [for t1 from: 3 to: bytes length do [bytes  t1  0  [false]]]]. self  32767 and self  32768  [true] false] canBeSmall | t1 [[bytes length > 2  [for t1 from: 3 to: bytes length do [bytes  t1  0  [false]]]]. self  1 maxVal and self  1 minVal  [true] false] compare: t1 | t2 t3 [((bytes length = 1 and bytes  1 = 0) and t1 bytes length = 1) and t1 bytes  1 = 0  [2] neg  [t1 neg  [t1 bytes natcompare: bytes] 1] t1 neg  [3] bytes natcompare: t1 bytes] even [(bytes  1 land: 1) = 0] field: t1 | t2 [t2 _ 15 - (t1 land: 15). self bits: t2 - (t1 / 16) + 1 to: t2] field: t1 _ t2 | t3 [t3 _ 15 - (t1 land: 15). self bits: t3 - (t1 / 16) + 1 to: t3 _ t2] hibit [bytes last hibit + (8 * (bytes length - 1))] intdiv: t1 | t2 t3 t4 t5 t6 [t5 _ bytes natdiv: t1 bytes. t2 _ t5  1. t3 _ (t5  2) asInteger. t4 _ neg  t1 neg  false. [t2 last = 0  [t2 length < 2  [] t2 _ t2 growby: 1]]. t5  1 _ LargeInteger new bytes: t2 neg: t4. t5  2 _ [t4 and 0  t3  [t1 abs - t3] t3]. t5] isLarge land: t1 | t2 t3 t4 [NoteTaker  [t2 _ self logicArg bytes. t3 _ t1 asLarge logicArg bytes. t4 _ Natural new: 2. t4  1 _ t2  1 land: t3  1. t4  2 _ t2  2 land: t3  2. (LargeInteger new bytes: t4 neg: false) logicUnArg] self asSmall land: t1] logicArg | t1 t2 t3 [neg  [t1 _ Natural new: 2. t2 _ (bytes  1 lxor: 255) + 1. t1  1 _ t2 land: 255. t2 _ t2 lshift: 8. t1  2 _ (bytes  2 lxor: 255) + t2 land: 255. LargeInteger new bytes: t1 neg: false]] logicUnArg | t1 [bytes length  2  [user notify: 'not logic arg'] (bytes  2 land: 128)  0  [t1 _ (bytes  1 lxor: 255) + 1. bytes  1 _ t1 land: 255. t1 _ t1 lshift: 8. bytes  2 _ (bytes  2 lxor: 255) + t1 land: 255. neg _ true] self asInt16] lor: t1 | t2 t3 t4 [NoteTaker  [t2 _ self logicArg. t3 _ t1 asLarge logicArg. t4 _ Natural new: 2. t4  1 _ t2  1 lor: t3  1. t4  2 _ t2  2 lor: t3  2. (LargeInteger new bytes: t4 neg: false) logicUnArg] self asSmall lor: t1] lshift: t1 | t2 t3 t4 t5 t6 [NoteTaker  [t2 _ self logicArg. t3 _ Natural new: 2. t3  1 _ t2 bytes  1. t3  2 _ t2 bytes  2. t2 bytes: t3 neg: false. t6 _ t1 abs. t6  16  [0] t4 _ t6 / 2. t5 _ t6 - t4. t4 _ 1 lshift: t4. t5 _ 1 lshift: t5. t6 _ t4 asLarge * t5 asLarge. t2 _ [t1 < 0  [t2 / t6] t2 * t6]. t3 _ Natural new: 2. t3  1 _ t2 bytes  1. t3  2 _ t2 bytes  2. (LargeInteger new bytes: t3 neg: false) logicUnArg] self asSmall lshift: t1] ltand: t1 | t2 t3 t4 [t2 _ self logicArg bytes. t3 _ t1 asLarge logicArg bytes. t4 _ Natural new: 2. t4  1 _ t2  1 land: t3  1. t4  2 _ t2  2 land: t3  2. (LargeInteger new bytes: t4 neg: false) logicUnArg] lxor: t1 | t2 t3 t4 [NoteTaker  [t2 _ self logicArg. t3 _ t1 asLarge logicArg. t4 _ Natural new: 2. t4  1 _ t2  1 lxor: t3  1. t4  2 _ t2  2 lxor: t3  2. (LargeInteger new bytes: t4 neg: false) logicUnArg] self asSmall lxor: t1] neg [neg] neg_ t1 [neg _ t1] negate [LargeInteger new bytes: bytes neg: neg  false] negated [LargeInteger new bytes: bytes neg: neg  false] nomask: t1 [0 = (self land: t1)] printon: t1 base: t2 [[neg  [t1 append: '']]. bytes printon: t1 base: t2] Class new title: ListPane subclassof: Textframe fields: 'list firstShown lastShown selection scrollBar' declare: '' close [selection _ 0. scrollBar close] compselection [selection  0  [self selectionRect comp]] deselected dirty [false] displayall [self displaylines: firstShown to: lastShown] dummy [''] eachtime [[window has: user mp  [user kbck  [self kbd] [user anybug  [user redbug  [self redbug] user yellowbug  [self yellowbug] user bluebug  [false]]]. user anykeys  [self keyset]]]. self outside] enter [scrollBar show] fill [[firstShown  nil  [self makeParagraph] lastShown _ self lineofy: window maxY - (style lineheight - 1)]. [self locked or selection > 0  [selection < firstShown  [frame origin y_ window minY - (selection * style lineheight) + style lineheight] selection > lastShown  [frame origin y_ window minY - (selection * style lineheight + style lineheight) + (window maxY - window minY | style lineheight) min: window minY]]]. firstShown _ self lineofy: window minY + (style lineheight - 1). lastShown _ self lineofy: window maxY - (style lineheight - 1)] firstShown: t1 | t2 t3 [t2 _ t1 - firstShown. t3 _ 0  (0 - t2 * style lineheight). firstShown _ t1. lastShown _ lastShown + t2. frame moveby: t3. (window origin - t3 rect: window corner) blt: window origin mode: storing. self displaylines: (firstShown max: lastShown - t2 + 1) to: lastShown] firsttime [window has: user mp  [self enter] false] frame_ t1 [window _ t1. frame _ window inset: 2  0 and: 0  0. frame width_ 999. self fill. scrollBar _ [scrollBar  nil  [ScrollBar new] scrollBar] on: window from: self] grayselection [selection  0  [self selectionRect color: ltgray mode: oring]] init [self para: nil frame: nil] kbd [window flash. user kbd] keyset | t1 t2 [t1 _ user currentCursor. self scrollControl [t2 _ user keyset. [t2 = 6  [2] t2 = 12  [2] t2 = 2  [1] t2 = 8  [1] 0]]. t1 show] lastShown: t1 | t2 t3 [t2 _ t1 - lastShown. t3 _ 0  (0 - t2 * style lineheight). lastShown _ t1. firstShown _ firstShown + t2. frame moveby: t3. (Rectangle new origin: window origin extent: window width  (window height - t3 y | style lineheight)) blt: window origin + t3 mode: storing. self displaylines: firstShown to: (firstShown - t2 - 1 min: lastShown)] lasttime [self leave] leave [scrollBar hide] locked [[selection = 0  [false] self dirty]] makeParagraph | t1 t2 t3 [[firstShown  nil  [firstShown _ 1. selection _ 0]]. t3 _ (String new: 200) asStream. t3 append: self dummy. t3 cr. [list  nil  [] for t1 to: list length do [list  t1 printon: t3. t3 cr]]. t3 append: self dummy. t3 cr. para _ t3 contents asParagraph. self measureall. lastShown _ self lineofy: window maxY - (style lineheight - 1). frame corner y_ (self yofline: lastline) + style lineheight. selection > lastShown  [selection _ 0]] of: t1 [list _ t1. selection _ 0. self makeParagraph. self frame_ window. self outline. self displayall. self deselected] outline [window outline: 1] outside [scrollBar startup] picked [window has: user mp] redbug | t1 t2 [t2 _ self locked. [t2  [] self compselection. t1 _ ((self lineofy: user mp y) max: 1) - 1. XeqCursor showwhile [self select: [t1 = selection  [0] t1]]]. while (user anybug and (window has: user mp)) do [t2  [t2 flash. self compselection. self compselection]]] revise: t1 with: t2 | t3 [t3 _ list  t1. [t3  [list _ t1. self makeParagraph. self fill. self displayall] selection > 0  [t3 _ list  selection  t2. t3  [self compselection]] t3 _ true]. t3  [selection _ 1. self select: (list find: t2)]] scrollPos [(firstShown  nil or list  nil) or list length = 0  [0.0] (firstShown - 1) asFloat / list length] scrollTo: t1 | t2 t3 [self scrollUp: (t1 * lastline) asInteger - firstShown + 1 * style lineheight] scrollUp: t1 | t2 [self compselection. t1 _ t1 | style lineheight. t2 _ (self lineofy: window minY + t1) max: 1. [t1 > 0  [lastline = lastShown  [] self locked  [selection + 1 = firstShown  [window flash] self firstShown: (t2 min: selection + 1)] self firstShown: (t2 min: lastline - (window height / style lineheight) + 1)] firstShown = 1  [] self locked  [selection + 1 = lastShown  [window flash] self lastShown: (lastShown - (firstShown - t2) max: selection + 1)] self lastShown: (lastShown - (firstShown - t2) max: (lastline min: window height / style lineheight))]. (window origin x  ((self yofline: lastline) + style lineheight) rect: window corner) clear: white. self select: selection] select: t1 | t2 [t2 _ selection. (1 max: firstShown - 1)  t1 and t1  (list length min: lastShown - 1)  [selection _ t1. self compselection. t2  selection  [self selected]] selection _ 0. t2  selection  [self deselected]] selected selectionRect | t1 [t1 _ selection * style lineheight + frame minY. (Rectangle new origin: frame minX  t1 corner: frame maxX  (t1 + style lineheight)) intersect: window] windowenter [self outline. self displayall. self compselection] windowleave [self compselection. self grayselection] yellowbug [window flash] Class new title: MachineDouble subclassof: Number fields: 'high low' declare: 'high8 low4 low8 high4 ' < t1 [high = t1 high  [low < t1 low] high < t1 high] asInt | t1 t2 [(high lshift: 8) lor: low] classInit [low4 _ 64. high4 _ 68] decreaseby: t1 | t2 [t2 _ low - t1. [t2 < 0  [high _ high - 1 land: 255]]. low _ t2 land: 255] extract | t1 [t1 _ low. low _ high. high _ [(low land: 128) = 0  [0] 255]. t1] gets: t1 mtimes: t2 | t3 t4 t5 t6 t7 t8 [t3 _ t1 lshift: 4. t4 _ t1 land: 15. t5 _ t2 lshift: 4. t6 _ t2 land: 15. low _ t6 * t4. high _ t5 * t3. t8 _ t5 * t4. t7 _ t8 + (t6 * t3). high _ high + (t7 lshift: 4). low _ ((t7 land: 15) lshift: 4) + low. low  256  [high _ high + 1. low _ low - 256]] high [high] high_ t1 [high _ t1] increaseby: t1 | t2 [t2 _ low + t1. [t2 > 255  [high _ high + 1 land: 255]]. low _ t2 land: 255] init [low _ 0. high _ 0] low [low] low_ t1 [low _ t1] mdiv: t1 | t2 [high > t1  [user notify: 'illegal MachineDouble division'] high < 64  [t2 _ high * 256 + low. high _ t2 \ t1. t2 / t1] high < 128  [t2 _ (high lshift: 2) + (low lshift: 6) - t1. high _ t2 lshift: 2. low _ low field: 38 _ t2. (self mdiv: t1) + 64] t2 _ (high lshift: 1) + (low lshift: 7) - t1. high _ t2 lshift: 1. low _ low field: 23 _ t2. (self mdiv: t1) + 128] printon: t1 [t1 append: '[MachineDouble 0'. high printon: t1 base: 8. t1 append: ' 0'. low printon: t1 base: 8. t1 append: ']'] Class new title: Menu subclassof: Object fields: 'str text thisline frame' declare: '' bug | t1 t2 [t2 _ self movingsetup. t1 _ self bugit. frame bitsFromString: t2. t1] bugit | t1 t2 [user nobug  [0] thisline comp. while true do [t1 _ user mp. text frame has: t1  [user anybug  [thisline has: t1  [] t1 _ text ptofpt: t1. thisline comp. thisline moveto: text frame origin x  t1 y. thisline comp] 1 + (thisline origin y - text frame origin y / text lineheight)] thisline comp. until (text frame has: user mp) do [user nobug  [0]]. thisline comp]] clear [frame clear] fbug | t1 [t1 _ self bugit. t1] frame [frame] has: t1 [text frame has: t1] moveto: t1 [self clear. frame moveto: t1. text frame moveto: t1 + 2. thisline moveto: t1 + 2] movingsetup | t1 t2 [t1 _ user mp - thisline center. text frame moveby: t1. thisline moveby: t1. frame moveby: t1. t2 _ frame bitsIntoString. frame clear: black. text displayall. t2] rebug [user waitbug. self bug] rescan [self string: str] show [frame clear: black. text displayall] string: t1 | t2 t3 t4 [str _ t1. [str last  13  [str _ str + ' ']]. t4 _ str asParagraph. t3 _ 0  0. text _ Textframe new para: t4 frame: (Rectangle new origin: t3 corner: 1000  1000). t3 _ text maxx: str length + 1. text frame growto: t3 + (4  0). text measureall. t4 center. frame _ text frame inset: 2  2. thisline _ Rectangle new origin: text frame origin corner: text frame corner x  text lineheight] stringFromVector: t1 | t2 [t2 _ Stream default. for t1 from: t1 do [t2 append: t1. t2 cr]. self string: t2 contents] zbug | t1 t2 [t2 _ self movingsetup. while [t1 _ self bugit. t1 = 0] do []. frame bitsFromString: t2. t1] Class new title: MessageDict subclassof: HashSet fields: 'methods " which are the compiled methods for each message" literals " which hold pointers to literals used in the methods" code " which are the source text for each message" backpointers " which are the tables of text location vs pc for each message"' declare: '' close | t1 [for t1 to: methods length do [methods  t1  nil  [] self freeMethod: methods  t1]. self init] code [code] code: t1 [NoteTaker  ['no code' asParagraph] code  (self findorerror: t1)] code: t1 _ t2 [NoteTaker  [t2] code  self findorerror: t1 _ t2] copyfrom: t1 [self objects_ t1 objects copy. methods _ t1 methods copy. code _ t1 code copy] delete: t1 | t2 [t2 _ self findorerror: t1. self freeMethod: methods  t2. methods  t2 _ nil. [NoteTaker  [] code  t2 _ nil]. super delete: t1] freeLiterals: t1 | t2 t3 t4 [t1 length = 0  [] t2 _ t1 nail. for t3 to: t1 length do [t4 _ mem  (t2 + t3 - 1). t1  t3 _ nil. mem  t2 + t3 - 1 _ t4]. t1 unNail] freeMethod: t1 [t1  nil  [] NoteTaker  [(nil swap [t1]) free] t1 refct > 2  [MethodKeeper next_ t1] self rawLiteralsIn: t1] freeMethods | t1 t2 [t1 _ MethodKeeper contents. MethodKeeper _ (Vector new: 10) asStream. for t2 to: t1 length do [self freeMethod: t1  t2]] growto: t1 | t2 t3 t4 [t3 _ MessageDict new init: t1. for t2 from: self do [t4 _ self findorerror: t2. t3 _ t3 insert: t2 method: methods  t4 literals: [literals  nil  [nil] literals  t4] code: [NoteTaker  [nil] code  t4] backpointers: nil]. t3] holdLiterals: t1 [NoteTaker  [t1] t1  nil  [t1] t1 length = 0  [t1] BitBlt new bltObj: t1 copy field: 1 to: t1 length fromObj: nil field: 0. t1] holdMethods: t1 | t2 [for t2 to: t1 length do [self insert: t2 method: t1  t2 literals: nil code: nil backpointers: nil]] init: t1 [methods _ Vector new: t1. [NoteTaker  [] code _ Vector new: t1]. super init: t1] insert: t1 method: t2 literals: t3 code: t4 backpointers: t5 | t6 t7 [t6 _ self find: t1. t6  [self freeMethod: methods  t6. [NoteTaker  [] self holdLiterals: t3]. methods  t6 _ t2. NoteTaker  [] code  t6 _ t4] t7 _ [self sparse  [self] self growto: methods length * 2]. t7 objects  t7 findornil: t1 _ t1. t7 insert: t1 method: t2 literals: t3 code: t4 backpointers: t5] invert: t1 | t2 [for t2 to: methods length do [methods  t2  t1  [objects  t2]]. false] literals: t1 [self literalsIn: methods  (self findorerror: t1)] literalsIn: t1 [NoteTaker  [t1  nil  [Vector new: 0] t1 literals] self holdLiterals: (self rawLiteralsIn: t1)] method: t1 [methods  (self findorerror: t1)] methodorfalse: t1 | t2 [t2 _ self find: t1. t2  [methods  t2] false] methods [methods] purge: t1 [] rawLiteralsIn: t1 | t2 t3 [t1  nil  [Vector new: 0] t1 length < 10  [Vector new: 0] t3 _ t1  6 - 6 / 2. t2 _ Vector new: (t3 max: 2). BitBlt new bltObj: t2 field: 1 to: t3 fromObj: t1 field: 4. t2] swap: t1 with: t2 [methods swap: t1 with: t2. [NoteTaker  [] code swap: t1 with: t2]. super swap: t1 with: t2] Class new title: Natural subclassof: String fields: '' declare: 'Naturalzero '; bytesize: false  t1 [super length < t1  [0] super  t1] asInteger [self length = 1  [self  1] LargeInteger new bytes: self neg: false] classInit [Naturalzero _ Natural new: 1. Naturalzero  1 _ 0] isLarge [false] natadd: t1 | t2 t3 t4 t5 t6 [t5 _ MachineDouble init. [self length < t1 length  [t3 _ t1. t2 _ self] t3 _ self. t2 _ t1]. t6 _ Natural new: t3 length. for t4 to: t3 length do [t5 increaseby: t3  t4. t5 increaseby: t2  t4. t6  t4 _ t5 extract]. [t5 low  0  [t6 _ t6 growby: 1. t6 last_ t5 low]]. t6] natcompare: t1 | t2 t3 t4 [t3 _ self length. t3 > t1 length  [3] t3 < t1 length  [1] for t2 from: self length to: 1 by: 1 do [t4 _ self  t2. t4 > (t1  t2)  [3] t4 < (t1  t2)  [1]]. 2] natdiv: t1 | t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 [t16 _ self length - t1 length + 1. t16  0  [Naturalzero , self] t5 _ 8 - t1 last hibit. t3 _ self natnormalize: t5. t6 _ t1 natnormalize: t5. t2 _ Natural new: t16. t11 _ t6 length - 1. t4 _ t16. t7 _ t6  t11. t8 _ [t11 = 1  [0] t6  (t11 - 1)]. t9 _ MachineDouble init. t10 _ MachineDouble new. for t15 to: t4 do [t14 _ t3 length + 1 - t15. t9 high_ t3  t14. [t9 high = t7  [t12 _ 1] t9 low_ t3  (t14 - 1). t12 _ t9 mdiv: t7. t9 low_ [t14 < 3  [0] t3  (t14 - 2)]. t10 gets: t12 mtimes: t8. t19 _ true. while (t9 < t10 and t19) do [t12 _ t12 unsignedadd: 1. t10 decreaseby: t8. t10 high < t7  [t19 _ false] t10 high_ t10 high - t7]]. t16 _ t14 - t11. t10 init. t17 _ 0. for t13 to: t6 length do [t9 gets: t12 mtimes: t6  t13. t10 increaseby: t3  t16. t10 decreaseby: t17. t10 decreaseby: t9 low. t17 _ t9 high. t3  t16 _ t10 extract. t16 _ t16 + 1]. [t10 low = 255  [t12 _ t12 unsignedadd: 1. t16 _ t14 - t11. t9 init. for t13 to: t6 length do [t9 increaseby: t3  t16. t9 increaseby: t6  t13. t3  t16 _ t9 extract. t16 _ t16 + 1]]]. t2  t2 length + 1 - t15 _ t12]. t3 _ t3 natunnormalize: t5 lookfirst: t11. [t2 last = 0  [t4 < 2  [] t2 _ t2 growby: 1]]. t2 , t3] natdivideandCarry: t1 extra: t2 | t3 t4 t5 [t5 _ t2  2. t5 high_ 0. t4 _ t2  1. for t3 from: t4 to: 1 by: 1 do [t5 low_ self  t3. self  t3 _ t5 mdiv: t1]. [self  t4 = 0  [t4 _ t4 - 1. t4 = 0  [t4 _ 1]]]. t2  1 _ t4. t5 high] natnormalize: t1 | t2 t3 t4 t5 t6 [t4 _ Natural new: self length + 1. t2 _ 0. t5 _ t1 - 8. for t3 to: t4 length do [t6 _ self  t3. t4  t3 _ ((t6 lshift: t1) lor: t2) land: 255. t2 _ t6 lshift: t5]. t4] natsubtract: t1 | t2 t3 t4 t5 t6 t7 t8 t9 t10 [t7 _ self length. t8 _ t1 length. t5 _ MachineDouble init. [t7 = t8  [t4 _ t7. while (self  t4 = (t1  t4) and t4 > 1) do [t4 _ t4 - 1]. t7 _ t4. self  t4 unsignedlessthan: t1  t4  [t3 _ t1. t9 _ true. t2 _ self] t3 _ self. t2 _ t1. t9 _ false] t7 < t8  [t3 _ t1. t2 _ self. t9 _ true. t7 _ t8] t3 _ self. t2 _ t1. t9 _ false]. t6 _ Natural new: t3 length. t10 _ 1. for t4 to: t3 length do [t5 increaseby: t3  t4. t5 decreaseby: t2  t4. (t6  t4 _ t5 extract)  0  [t10 _ t4]]. [t10 = t3 length  [] t5 _ Natural new: t10. for t4 to: t10 do [t5  t4 _ t6  t4]. t6 _ t5]. LargeInteger new bytes: t6 neg: t9] nattimes: t1 | t2 t3 t4 t5 t6 t7 t8 t9 [self length = 1 and self  1 = 0  [Naturalzero] t4 _ self length + t1 length. t2 _ Natural new: t4. t3 _ MachineDouble new. for t7 to: t4 do [t2  t7 _ 0]. for t7 to: self length do [t9 _ t7 - 1. t5 _ 0. t6 _ self  t7. t6  0  [for t8 to: t1 length do [t3 gets: t6 mtimes: t1  t8. t3 increaseby: t5. t9 _ t9 + 1. t3 increaseby: t2  t9. t2  t9 _ t3 low. t5 _ t3 high]. t2  t9 + 1 _ t5]]. t2  t4 = 0  [t2 growby: 1] t2] natunnormalize: t1 lookfirst: t2 | t3 t4 t5 t6 t7 [t1 _ 0 - t1. t3 _ 0. t6 _ t1 + 8. t4 _ t2. t7 _ self  t4. while (((t7 lshift: t1) lor: t3) = 0 and t4  1) do [t3 _ t7 lshift: t6. t4 _ t4 - 1. t7 _ self  t4]. t5 _ Natural new: t4. t2 _ t4. t3 _ self  1 lshift: t1. for t4 to: t2 do [t7 _ self  (t4 + 1). t5  t4 _ (t7 lshift: t6) lor: t3. t3 _ t7 lshift: t1]. t5] printon: t1 [self printon: t1 base: 10] printon: t1 base: t2 | t3 t4 t5 t6 t7 [t3 _ Stream default. t4 _ self length , MachineDouble new. t5 _ Natural new: super length. t6 _ t2 * t2. self copyto: t5. until (t4  1 = 1 and t5  1 < t6) do [t7 _ t5 natdivideandCarry: t6 extra: t4. t3 next_ t7 \ t2 + 48. t3 next_ t7 / t2 + 48]. t5  1 printon: t1 base: t2. t1 append: t3 contents reverse] species [Natural] Class new title: NotifyWindow subclassof: PanedWindow fields: 'enoughpanes' declare: 'smallFrame smallTemplates bigTemplates ' aboutToFrame [enoughpanes _ panes length = 6. super aboutToFrame] classInit [smallTemplates _ (0  0 rect: 36  36) inVector. bigTemplates _ (0  0 rect: 12  18) , (12  0 rect: 36  18) , (0  18 rect: 12  27) , (12  18 rect: 36  27) , (0  27 rect: 12  36) , (12  27 rect: 36  36). smallFrame _ 204  366 rect: 404  402] enter | t1 t2 t3 t4 t5 t6 [enoughpanes  [super enter] NotifyFlag _ false. t1 _ panes  1. t2 _ CodePane new. t3 _ VariablePane new. t4 _ CodePane new. t5 _ VariablePane new. t6 _ CodePane new. self title: title with: t1 , t2 , t3 , t4 , t5 , t6 at: bigTemplates. self frame: frame. self show. t1 context: t3 instance: t5 code: t2. t2 from: t1. t3 to: t4. t4 from: t3. t5 to: t6. t6 from: t5. t1 select: 0. t1 deselected. t1 makeParagraph. t1 fill. t1 displayall. NotifyFlag _ true. enoughpanes _ NotifyFlag] of: t1 level: t2 interrupt: t3 | t4 [NotifyFlag _ false. t4 _ StackPane new. self title: t1 with: t4 inVector at: smallTemplates. smallFrame moveto: [t2 > 1  [300  50] user screenrect center - (smallFrame extent / 2)]. self frame: (self fixframe: smallFrame). self show. t4 context: false at: t2 instance: false code: false. t4 interrupt: t3. t4 of: (Top  t2) inVector. NotifyFlag _ true] of: t1 stack: t2 interrupt: t3 | t4 [NotifyFlag _ false. t4 _ StackPane new. self title: t1 with: t4 inVector at: smallTemplates. smallFrame moveto: [Top currentPriority > 1  [300  50] user screenrect center - (smallFrame extent / 2)]. self frame: (self fixframe: smallFrame). self show. t4 context: false instance: false code: false. t4 interrupt: t3. t4 of: t2 inVector. NotifyFlag _ true] Class new title: NotifyWindowNT subclassof: NotifyWindow fields: ' ' declare: '' close | t1 [for t1 from: panes do [t1 close]. self erase. user unschedule: self. thisContext restart] title: t1 processFrame: t2 | t3 [NotifyFlag _ false. t3 _ StackPaneNT new. self title: t1 with: t3 inVector at: smallTemplates. smallFrame moveto: user screenrect center - (smallFrame extent / 2). self frame: (self fixframe: smallFrame). self show. t3 processFrame: t2. NotifyFlag _ true] Class new title: Number subclassof: Object fields: '' declare: ''  t1 [self = t1  false]  t1 [Point new x: self y: t1] < t1 [self - t1 < 0] = t1 [self - t1 = 0] > t1 [self - t1 > 0] abs [self < 0  [self * 1]] asPoint [self  self] asPtX asPtY asRectCorner asRectOrigin asRectangle [self  self rect: self  self] base8 [self base: 8] base: t1 | t2 [t2 _ Stream default. t2 append: '0'. self printon: t2 base: t1. [t1 = 16  [t2 append: 'H']]. t2 contents] between: t1 and: t2 [t1  self and self  t2] cansubscript: t1 [self asInteger cansubscript: t1] compare: t1 [self < t1  [1] self = t1  [2] 3] factorial [self = 0  [1] self * (self - 1) factorial] for: t1 [Interval new from: self to: self + (t1 - 1) by: 1] hex [self base: 16] isLarge [false] isNumber log2 | t1 t2 [self < 0  [(self * 1) log2] self < 1  [(self / self / self) log2 * 1] t1 _ 1. t2 _ 0. while self  t1 do [t1 _ t1 + t1. t2 _ t2 + 1]. t2 - 1] max: t1 [self < t1  [t1]] min: t1 [self > t1  [t1]] printon: t1 [self printon: t1 base: 10] sign [[self = 0  [0] self < 0  [1] 1]] subscripts: t1 [t1  self asInteger] subscripts: t1 _ t2 [t1  self asInteger _ t2] to: t1 [Interval new from: self to: t1 by: 1] to: t1 by: t2 [Interval new from: self to: t1 by: t2] within: t1 [t1 start  self and self  t1 stop] ~ t1 [Interval new from: self to: t1 by: 1] Class new title: Object subclassof: nil fields: '' declare: ''  t1 [self > t1  false]  t1 [self  t1] primitive: 56  t1 [self = t1  false]  t1 [self < t1  false]  t1 [Generator new evaluate: t1 asStream in: false to: self notifying: self] , t1 | t2 [t2 _ Vector new: 2. t2  1 _ self. t2  2 _ t1. t2] = t1 [self  t1] Altonail [user croak] primitive: 53 AltounNail [user croak] primitive: 53 Is: t1 [self class  t1  [true] self class Isa: t1] Isnt: t1 [(self Is: t1)  false] PTR [] primitive: 36 and t1 [self  [t1 eval] false] and: t1 [self  [t1] false] argsOff: t1 [self  [t1 pop: 1]] asFullString | t1 [t1 _ (String new: 20) asStream. self fullprinton: t1. t1 contents] asOop [user croak] primitive: 36 asParagraph [self asString asParagraph] asRemoteCode: t1 [ParsedRemote new expr: self] asStream [self asVector asStream] asString | t1 [t1 _ (String new: 16) asStream. self printon: t1. t1 contents] asVector | t1 [self  nil  [Vector new: 0] t1 _ Vector new: 1. t1  1 _ self. t1] become: t1 [user croak] primitive: 38 canunderstand: t1 [self class canunderstand: t1] class [user croak] primitive: 24 copy [self is: Object  [self] self class copy: self] emitForEffect: t1 on: t2 [] emitForTruth: t1 falsity: t2 into: t3 on: t4 [self emitForValue: t3 on: t4. t1 jmpSize + t2 emitBfp: t3 on: t4. t1 emitJmp: t3 on: t4] emitForValue: t1 on: t2 [] emitsLoad [false] emittedReceiver [false] emittedVariable [false] empty [self length = 0] eqv: t1 [t1  [self] self  false] error [user notify: 'message not understood.'] error: t1 [user notify: t1] fields [self class is: VariableLengthClass  [self length  50  [1 to: self length] (1 to: 20) concat: (self length - 20 to: self length)] self class instvars] filout | t1 [user displayoffwhile [t1 _ dp0 file: self title asFileName. self fullprinton: t1. t1 close]] findMacros: t1 compilerTemps: t2 [] firstPush [1] fullprint | t1 [t1 _ Stream default. self fullprinton: t1. user show: t1 contents] fullprinton: t1 [self  nil  [t1 append: 'nil'] self  false  [t1 append: 'false'] self  true  [t1 append: 'true'] self class print: self on: t1] growTo: t1 [user croak] primitive: 52 hash [user croak] primitive: 36 inVector | t1 [t1 _ Vector new: 1. t1  1 _ self. t1] inspect [user leaveTop. user restartup: (InspectWindow new of: self)] inspectfield: t1 [self class is: VariableLengthClass  [self  (self fields  t1)] self instfield: t1] installError | t1 t2 [t1 _ Object md method: error. t2 _ SpecialOops  1. t2 asOop  (mem  3)  [user notify: 'Object installError failed'] Top critical [mem  3 _ t1 asOop. SpecialOops  1 _ t1]] instfield: t1 [user croak] primitive: 46 instfield: t1 _ t2 [user croak] primitive: 47 instfields | t1 t2 t3 [self class is: VariableLengthClass  [self  self fields] t2 _ self class instsize. t1 _ Vector new: t2. for t3 to: t2 do [t1  t3 _ self instfield: t3]. t1] interactive [false] is: t1 [self class  t1] isArray [false] isField [false] isNumber [false] isnt: t1 [self class  t1  false] itself messageNotUnderstood: t1 withArgs: t2 from: t3 [thisContext sender_ t3. user notify: 'Message not understood: ' + t1] nail [NoteTaker  [] self Altonail] notify: t1 at: t2 in: t3 [self notify: t1 at: t2 in: t3 for: self class] notify: t1 at: t2 in: t3 for: t4 | t5 [NotifyFlag  [t5 _ SyntaxWindow new of: t1 at: t2 in: t3 for: t4 from: thisContext sender. thisContext sender_ nil. user restartup: t5] user notify: t1. false] or t1 [self  [true] t1 eval] or: t1 [self  [true] t1] perform: t1 [t1 mustTake: 0. self performDangerously: t1] perform: t1 with: t2 [t1 mustTake: 1. self performDangerously: t1 with: t2] perform: t1 with: t2 with: t3 [t1 mustTake: 2. self performDangerously: t1 with: t2 with: t3] perform: t1 with: t2 with: t3 with: t4 [t1 mustTake: 3. self performDangerously: t1 with: t2 with: t3 with: t4] perform: t1 withArgs: t2 [t1 mustTake: t2 length. self performDangerously: t1 withArgs: t2] performDangerously: t1 [user notify: 'can''t perform: nil'] primitive: 48 performDangerously: t1 with: t2 [user notify: 'can''t perform: nil with:'] primitive: 48 performDangerously: t1 with: t2 with: t3 [user notify: 'can''t perform: nil with:with:'] primitive: 48 performDangerously: t1 with: t2 with: t3 with: t4 [user notify: 'can''t perform: nil with:with:with:'] primitive: 48 performDangerously: t1 withArgs: t2 | t3 [t3 _ t2 length. t3 = 0  [self performDangerously: t1] t3 = 1  [self performDangerously: t1 with: t2  1] t3 = 2  [self performDangerously: t1 with: t2  1 with: t2  2] t3 = 3  [self performDangerously: t1 with: t2  1 with: t2  2 with: t2  3] user notify: 'More than 3 args for perform:'] print [user show: self asString] printon: t1 | t2 [t1 append: [self  nil  ['nil'] self  false  ['false'] self  true  ['true'] t2 _ self class title. t1 append: ['AEIO' has: t2  1  ['an '] 'a ']. t2]] printon: t1 indent: t2 precedence: t3 forValue: t4 decompiler: t5 [] recopy [self is: Object  [self] self class recopy: self] ref: t1 [FieldReference new object: self offset: t1] refct [user croak] primitive: 49 remote: t1 [] returns [false] sameAs: t1 [self  t1] sizeForEffect: t1 [0] sizeForTruth: t1 falsity: t2 | t3 [t3 _ t1 jmpSize. self sizeForValue + (t3 + t2) bfpSize + t3] sizeForValue [0] startup [self firsttime  [while self eachtime do []. self lasttime] false] subError [self error: 'message not defined by subclass'] swap t1 | t2 [t2 _ t1 value. t1 value_ self. t2] title [self class title + '.' + self asOop base8] unNail [NoteTaker  [] self AltounNail] xor: t1 [t1  [self  false] self] Class new title: ObjectReference subclassof: Object fields: 'object' declare: '' eval [object] object: t1 [object _ t1] printon: t1 [t1 append: '->'. t1 print: object] value [object] value_ t1 [object _ t1. object] Class new title: OrganizationPane subclassof: ListPane fields: 'classPane selectorPane class' declare: 'editmenu ' class: t1 [class _ t1. self of: (self listFor: class)] classInit [editmenu _ Menu new string: 'filout print'] close [classPane _ nil. super close] code: t1 [class code: t1] compile: t1 | t2 t3 [class  nil or selection = 1  [classPane compile: t1] selection = 2  [class organization fromParagraph: t1. self class: class] t3 _ [selection = 0  ['As yet unclassified'] list  selection]. t2 _ selectorPane compile: t1 in: class under: t3. t2  [self revise: (self listFor: class) with: t3. selection  0  [selectorPane revise: (class organization category: t3) with: t2]] false] deselected [selectorPane of: (Vector new: 0)] dirty [selectorPane dirty] execute: t1 [class  t1] forget: t1 | t2 [class derstands: t1. t2 _ list  selection. self revise: (self listFor: class) with: t2. selection > 0  [selectorPane revise: (class organization category: t2) with: t1]] from: t1 to: t2 [classPane _ t1. selectorPane _ t2] listFor: t1 [class _ t1. [class  nil  [Vector new: 0] (ClassDefinition ClassOrganization ) concat: class organization categories]] noCode [class  nil  [classPane noCode] selection = 0  [''] selection = 1  [class definition] selection = 2  [class organization] 'Message name and Arguments | Temporary variables "short comment" ["long comment if necessary" Smalltalk Statements]'] selected [selectorPane of: [selection  2  [Vector new: 0] class organization category: list  selection]] spawn: t1 with: t2 formerly: t3 [selectorPane compselection. selectorPane select: 0. class edit: t1 para: t2 formerly: t3] yellowbug | t1 [selection  1  [window flash] t1 _ editmenu bug. t1 = 1  [selection = 2  [class filoutOrganization] class filoutCategory: list  selection] t1 = 2  [selection = 2  [window flash] class printoutCategory: list  selection]] Class new title: PanedWindow subclassof: Window fields: 'panes templates title' declare: '' close | t1 [for t1 from: panes do [t1 close]] eachtime | t1 [[frame has: user mp  [user bluebug  [self bluebug] for t1 from: panes do [t1 startup]]]. self outside  [] user anybug  [frame has: user mp  [] false] user kbck  [user kbd. frame flash]] enter | t1 [super show. for t1 from: panes do [t1 windowenter]] erase [self titlerect clear. super erase] fixframe: t1 [Rectangle new origin: t1 origin extent: (t1 extent max: 160  80)] frame: t1 | t2 t3 t4 t5 t6 [frame _ t1. t2 _ templates asStream. t5 _ frame origin - 1. t6 _ frame extent + 2. for t4 from: panes do [t3 _ t2 next. t4 frame_ t3 * t6 / 36 + t5 inset: 1]] hardcopy | t1 [user displayoffwhile [t1 _ dp0 pressfile: (self title + '.press') asFileName. self hardcopy: t1. t1 close. t1 toPrinter]] hardcopy: t1 | t2 [self showtitle. titleframe hardcopy: t1. for t2 from: panes do [t2 hardcopy: t1]] kbd | t1 [t1 _ self pickedpane. t1  [t1 kbd]] keyset | t1 [t1 _ self pickedpane. t1  [t1 keyset]] leave | t1 [for t1 from: panes do [t1 windowleave]] pickedpane | t1 [for t1 from: panes do [t1 picked  [t1]]. frame flash. false] redbug | t1 [t1 _ self pickedpane. t1  [t1 redbug]] show | t1 [super show. for t1 from: panes do [t1 outline]] takeCursor [(panes  1) takeCursor] title [title] title: t1 with: t2 at: t3 | t4 [title _ t1. panes _ t2. templates _ t3. self reset. for t4 from: panes do [t4 init]] titlerect [frame origin - (2  (DefaultTextStyle lineheight + 4)) rect: frame corner x  frame origin y + (2  0)] vanish [self close. self erase. user unschedule: self] yellowbug | t1 [t1 _ self pickedpane. t1  [t1 yellowbug]] Class new title: Paragraph subclassof: Array fields: 'text runs alignment' declare: ''  t1 [text  t1] alignment [alignment] alignment_ t1 [alignment _ t1] allBold [self maskrunsunder: 1 to: 1] allFont: t1 [[t1 is: String  [t1 _ (self textStyle fontnames find: t1) - 1]]. self maskrunsunder: 240 to: t1 * 16] allItalic [self maskrunsunder: 2 to: 2] asParagraph asStream [text asStream] asVector [text asVector] bravoRuns: t1 | t2 t3 t4 t5 t6 t7 t8 [t1 append: [alignment = 1  ['j\g'] alignment = 2  ['c\g'] '\g']. [runs  nil  [] t4 _ 0. t3 _ 256. t8 _ (1 2 4 ). for t2 to: runs length by: 2 do [t6 _ runs  (t2 + 1). t5 _ t3 lxor: t6. (t5 land: 247) = 0  [t4 _ t4 + (runs  t2)] [t2 = 1  [] t4 printon: t1]. for t7 to: 3 do [(t5 land: t8  t7) = 0  [] t1 next_ [(t6 land: t8  t7)  0  ['biu'] 'BIU']  t7]. [(t5 land: 240)  0  [t1 append: 'f'. t1 print: (t6 lshift: 4). t1 space]]. t3 _ t6. t4 _ runs  t2]]. t1 cr] center [alignment _ 2] copy [self class new text: text runs: runs alignment: alignment] copy: t1 to: t2 [self class new text: (text copy: t1 to: t2) runs: (self run: t1 to: t2) alignment: alignment] findString: t1 startingAt: t2 [text findString: t1 startingAt: t2] flushleft [alignment _ 0] flushright [alignment _ 4] hideData: t1 | t2 [t2 _ Stream new of: (String new: 150). t2 next_ t1. [t1 = 0  [t2 nextword_ text length] t2 nextString_ text]. t2 nextString_ [runs  nil  [nullString] runs]. t2 next_ alignment. t2 contents] justify [alignment _ 1] length [text length] makeBoldPattern | t1 t2 t3 [t1 _ text asStream. t2 _ 0. while [t3 _ t1 next. [t3  [t3 = 91 or (t3 = 124 or (t3 = 34 or (t3 = 25 or false)))] true]  false] do [t2 _ t2 + 1]. self maskrun: 1 to: t2 under: 1 to: 1] makerun: t1 val: t2 | t3 t4 [t1 = 0  [nullString] t3 _ String new: t1 - 1 / 255 + 1 * 2. for t4 to: t3 length by: 2 do [t3  t4 _ [t1 > 255  [255] t1]. t3  t4 + 1 _ t2. t1 _ t1 - 255]. t3] maskrun: t1 to: t2 under: t3 to: t4 | t5 t6 [t5 _ self run: t1 to: t2. for t6 from: 2 to: t5 length by: 2 do [t5  t6 _ (t5  t6 land: 255 - t3) + t4]. runs _ self runcat: (self run: 1 to: t1 - 1) and: t5 and: (self run: t2 + 1 to: text length)] maskrunsunder: t1 to: t2 [self maskrun: 1 to: text length under: t1 to: t2] pressCode [99] readFrom: t1 [text _ t1 nextString. runs _ t1 nextString. alignment _ t1 next. runs empty  [runs _ nil]] replace: t1 to: t2 by: t3 [[runs  nil  [] runs _ self runcat: (self run: 1 to: t1 - 1) and: [t3 is: self class  [t3 runs] self makerun: t3 length val: [runs empty  [0] runs  ((self runfind: t2)  1 + 1)]] and: (self run: t2 + 1 to: text length)]. text _ text replace: t1 to: t2 by: [t3 is: self class  [t3 text] t3]] run: t1 to: t2 | t3 [t1 > t2  [nullString] runs  nil  [self makerun: 1 + t2 - t1 val: 0] t1 _ self runfind: t1. t2 _ self runfind: t2. t3 _ runs copy: t1  1 to: t2  1 + 1. [t1  1 = (t2  1)  [t3  1 _ 1 + (t2  2) - (t1  2)] t3  1 _ 1 + (runs  (t1  1)) - (t1  2). t3  t3 length - 1 _ t2  2]. t3] runAndVal: t1 | t2 t3 [runs  nil  [text length - t1 + 1 , 0] t2 _ 1. while [t3 _ t1 - (runs  t2). t3 > 0] do [t1 _ t3. t2 _ t2 + 2]. runs  t2 - t1 + 1 , (runs  (t2 + 1))] runcat: t1 and: t2 and: t3 | t4 t5 t6 t7 t8 t9 t10 [t10 _ Stream new of: (String new: 30). t8 _ false. for t4 to: 3 do [t5 _ [t4 = 1  [t1] t4 = 2  [t2] t3]. t5 length = 0  [] t5 _ t5 asStream. while [t7 _ t5 next. t7] do [t9 _ t5 next. t7 = 0  [] t8 = t9  [t6 _ t6 + t7. t6  255  [] t10 next_ 255. t10 next_ t8. t6 _ t6 - 255] [t8  [t10 next_ t6. t10 next_ t8]]. t6 _ t7. t8 _ t9]]. [t8  [t10 next_ t6. t10 next_ t8]]. t10 contents] runcat: t1 to: t2 [self runcat: t1 and: t2 and: ''] runfind: t1 | t2 t3 [t2 _ 1. while [t3 _ t1 - (runs  t2). t3 > 0] do [t1 _ t3. t2 _ t2 + 2]. t2 , t1] runs [runs  nil  [self makerun: text length val: 0] runs] storeOn: t1 [t1 nextString_ text. [runs  nil  [t1 next_ 0] t1 nextString_ runs]. t1 next_ alignment] subst: t1 for: t2 [text subst: t1 for: t2] text [text] text: t1 [text _ t1. alignment _ 0] text: t1 alignment: t2 [text _ t1. alignment _ t2] text: t1 runs: t2 alignment: t3 [text _ t1. runs _ t2. alignment _ t3] textStyle [DefaultTextStyle] Class new title: ParseStack subclassof: Object fields: 'position length' declare: '' init [position _ 0. length _ position] length [length] pop: t1 [position _ position - t1. position < 0  [user notify: 'Parse stack underflow']] position [position] push: t1 [position _ position + t1. position > length  [length _ position]] Class new title: ParsedAssignment subclassof: Object fields: 'var expr elide' declare: ''; sharing: ByteCodes emitForEffect: t1 on: t2 [expr emitForValue: t1 on: t2. t2 pop: 1. elide  [t1 next_ toSmash] t1 next_ toSmashPop. var emitBytes: t1] emitForValue: t1 on: t2 [expr emitForValue: t1 on: t2. t1 next_ toSmash. var emitBytes: t1] emittedVariable [var] expr [expr] findMacros: t1 compilerTemps: t2 [var findMacros: t1 compilerTemps: t2. expr findMacros: t1 compilerTemps: t2] firstPush [expr firstPush] isForFromInit: t1 | t2 t3 t4 [(expr isnt: ParsedMessage) or expr op  toAsStream  [false] t1 isnt: ParsedLoop  [false] t3 _ t1 whileExpr. (t3 isnt: ParsedBlock) or t3 position  2  [false] t3  1 isnt: ParsedAssignment  [false] t4 _ (t3  1) expr. t4 isnt: ParsedMessage  [false] t4 rcvr  var or t4 op  toNext  [false] true] isForFromToInit: t1 loop: t2 | t3 t4 t5 [(t1 isnt: ParsedAssignment) or (t2 isnt: ParsedLoop)  [false] [t1 expr  toLoad0  [] t1 expr isnt: ParsedMessage  [false] t1 expr op  toMinus or t1 expr args  toLoad1  [false]]. t3 _ t2 whileExpr. (t3 isnt: ParsedBlock) or t3 position  2  [false] t4 _ t3  1. t4 isnt: ParsedAssignment  [false] t4 var  t1 var  [false] (t4 expr isnt: ParsedMessage) or t4 expr op  toPlus  [false] t4 expr rcvr  toLoad1 or t4 expr args  t1 var  [false] t5 _ t3  2. t5 isnt: ParsedMessage  [false] (t5 rcvr  var or t5 op  toGeq) or t5 args  t4 var  [false] true] printon: t1 [t1 append: '('. t1 print: var. t1 append: '_'. t1 print: expr. t1 append: ')'] printon: t1 indent: t2 precedence: t3 forValue: t4 decompiler: t5 [[t3 > 1  [t1 append: '(']]. var printon: t1 indent: t2 precedence: 1 forValue: true decompiler: t5. t1 append: ' _ '. expr printon: t1 indent: t2 + 2 precedence: 1 forValue: true decompiler: t5. t3 > 1  [t1 append: ')']] sizeForEffect: t1 [elide _ t1  var. expr sizeForValue + 1 + [elide  [0] var sizeForValue]] sizeForValue [expr sizeForValue + 1 + var sizeForValue] var [var] var: t1 expr: t2 [var _ t1. expr _ t2] Class new title: ParsedBlock subclassof: Stream fields: 'returns' declare: ''; sharing: ByteCodes default [limit _ 1. array _ Vector new: 1. position _ 0. returns _ false] doesReturn [returns _ true] emitExceptLast: t1 on: t2 | t3 [for t3 to: position - 1 do [array  t3 emitForEffect: t1 on: t2]] emitForEffect: t1 on: t2 [returns  [self emitForValue: t1 on: t2. t2 pop: 1] self emitExceptLast: t1 on: t2. array  position emitForEffect: t1 on: t2] emitForTruth: t1 falsity: t2 into: t3 on: t4 [returns  [self emitForValue: t3 on: t4] self emitExceptLast: t3 on: t4. array  position emitForTruth: t1 falsity: t2 into: t3 on: t4] emitForValue: t1 on: t2 [self emitExceptLast: t1 on: t2. array  position emitForValue: t1 on: t2. returns  [t1 next_ toReturn]] findMacros: t1 compilerTemps: t2 | t3 t4 t5 [for t3 to: position do [t4 _ array  t3. (t4 isnt: ParsedAssignment) or (t4 var < codeLoadTemp or t4 var > (codeLoadTemp + 255))  [t4 findMacros: t1 compilerTemps: t2] t5 _ t4 var - codeLoadTemp + 1. t3  (position - 2) and (t4 isForFromToInit: array  (t3 + 1) loop: array  (t3 + 2))  [t1 next_ self. t1 next_ t3. t2  t5 _ true. t4 expr findMacros: t1 compilerTemps: t2. array  (t3 + 1) findMacros: t1 compilerTemps: t2. (array  (t3 + 2)) doExpr findMacros: t1 compilerTemps: t2. t3 _ t3 + 2] t3  (position - 1) and (array  t3 isForFromInit: array  (t3 + 1))  [t1 next_ self. t1 next_ t3. t2  t5 _ true. t4 expr findMacros: t1 compilerTemps: t2. (array  (t3 + 1)) doExpr findMacros: t1 compilerTemps: t2. t3 _ t3 + 1] t4 findMacros: t1 compilerTemps: t2]] firstPush [(array  1) firstPush] insertMacro: t1 decompiler: t2 | t3 t4 t5 [t3 _ ParsedForLoop new block: self loc: t1 decompiler: t2. array  t1 _ t3. t4 _ t3 nStatements. for t5 from: t1 + t4 to: position do [array  t5 - t4 + 1 _ array  t5]. position _ position - t4 + 1] mustReturn: t1 [returns  [] [t1  [position > 0 and (array  position) emitsLoad  [array  position _ toLoadSelf] self next_ toLoadSelf]]. self doesReturn] printon: t1 | t2 [t1 append: '['. for t2 to: position - 1 do [t1 print: array  t2. t1 append: '. ']. [returns  [t1 append: '']]. [position > 0  [t1 print: array  position]]. t1 append: ']'] printon: t1 indent: t2 precedence: t3 forValue: t4 decompiler: t5 | t6 [position = 0  [t1 append: '[]'] t1 append: '['. for t6 to: position - 1 do [array  t6 printon: t1 indent: t2 precedence: 0 forValue: false decompiler: t5. t1 append: '.'. t1 crtab: t2]. [returns  [t1 append: '']]. array  position printon: t1 indent: t2 precedence: 0 forValue: (returns or t4) decompiler: t5. t1 append: ']'] quickCode | t1 t2 [[position = 1 and (returns and [t2 _ array  1. t2 emitsLoad])  [t2 = toLoadSelf  [NoteTaker  [(CompiledMethod new: 2) toReturnSelf] t1 _ String new: 2. t1  1 _ 0. t1  2 _ 1. t1] t2 isField  [NoteTaker  [(CompiledMethod new: 2) toLoadField: (t2 land: 255) + 1] t1 _ String new: 5. t1  1 _ 0. t1  2 _ 40. t1  3 _ 0. t1  4 _ 0. t1  5 _ t2. t1] false]]. false] returns [returns] sizeExceptLast | t1 t2 t3 t4 [t4 _ 0. t2 _ array  position. for t1 to: position - 1 do [t3 _ t2 firstPush. t2 _ array  (position - t1). t4 _ t4 + (t2 sizeForEffect: t3)]. t4] sizeForEffect: t1 [returns  [self sizeForValue] self sizeExceptLast + (array  position sizeForEffect: t1)] sizeForTruth: t1 falsity: t2 [returns  [self sizeForValue] self sizeExceptLast + (array  position sizeForTruth: t1 falsity: t2)] sizeForValue [self sizeExceptLast + (array  position) sizeForValue + [returns  [1] 0]] Class new title: ParsedConditional subclassof: Object fields: 'ifExpr thenExpr elseExpr thenSize elseSize jmpSize' declare: '' emitForEffect: t1 on: t2 [ifExpr emitForValue: t1 on: t2. thenSize emitBfp: t1 on: t2. thenExpr emitForEffect: t1 on: t2. [jmpSize > 0  [elseSize emitJmp: t1 on: t2]]. elseExpr emitForEffect: t1 on: t2] emitForValue: t1 on: t2 [ifExpr emitForValue: t1 on: t2. thenSize emitBfp: t1 on: t2. thenExpr emitForValue: t1 on: t2. t2 pop: 1. [jmpSize > 0  [elseSize emitJmp: t1 on: t2]]. elseExpr emitForValue: t1 on: t2] findMacros: t1 compilerTemps: t2 [ifExpr findMacros: t1 compilerTemps: t2. thenExpr findMacros: t1 compilerTemps: t2. elseExpr findMacros: t1 compilerTemps: t2] firstPush [ifExpr firstPush] ifExpr: t1 thenExpr: t2 elseExpr: t3 [ifExpr _ t1. thenExpr _ t2. elseExpr _ t3] printon: t1 [t1 append: 'if '. t1 print: ifExpr. t1 append: 'then '. t1 print: thenExpr. t1 append: 'else '. t1 print: elseExpr] printon: t1 indent: t2 precedence: t3 forValue: t4 decompiler: t5 | t6 t7 [ifExpr printon: t1 indent: t2 precedence: 0 forValue: true decompiler: t5. t1 append: ' '. [thenExpr position > 1 or (thenExpr  1 is: ParsedConditional)  [t1 crtab: t2 + 1] t1 space]. thenExpr printon: t1 indent: t2 + 1 precedence: 0 forValue: t4 decompiler: t5. elseExpr position = 1 and elseExpr last  nil  [] t1 crtab: t2. t6 _ t1 position. t7 _ t1 pop. elseExpr printon: t1 indent: t2 precedence: 0 forValue: t4 decompiler: t5. t1 skip: 1. t1  t6 _ t7] returns [thenExpr returns and elseExpr returns] sizeForEffect: t1 [elseSize _ elseExpr sizeForEffect: t1. jmpSize _ [thenExpr returns  [0] elseSize jmpSize]. thenSize _ (thenExpr sizeForEffect: 1) + jmpSize. ifExpr sizeForValue + thenSize bfpSize + thenSize + elseSize] sizeForValue [elseSize _ elseExpr sizeForValue. jmpSize _ [thenExpr returns  [0] elseSize jmpSize]. thenSize _ thenExpr sizeForValue + jmpSize. ifExpr sizeForValue + thenSize bfpSize + thenSize + elseSize] Class new title: ParsedConjunct subclassof: Object fields: 'left right rightSize' declare: ''; sharing: ByteCodes emitForEffect: t1 on: t2 [left emitForValue: t1 on: t2. rightSize emitBfp: t1 on: t2. right emitForEffect: t1 on: t2] emitForTruth: t1 falsity: t2 into: t3 on: t4 [left emitForTruth: 0 falsity: rightSize + t2 into: t3 on: t4. right emitForTruth: t1 falsity: t2 into: t3 on: t4] emitForValue: t1 on: t2 [left emitForValue: t1 on: t2. rightSize emitBfp: t1 on: t2. right emitForValue: t1 on: t2. 1 emitJmp: t1 on: t2. t1 next_ toLoadFalse] emittedReceiver [left] emittedReceiver_ t1 [left _ t1] findMacros: t1 compilerTemps: t2 [left findMacros: t1 compilerTemps: t2. right findMacros: t1 compilerTemps: t2] firstPush [left firstPush] left: t1 right: t2 [left _ t1. right _ t2] printon: t1 [t1 append: '('. t1 print: left. t1 append: ' and '. t1 print: right. t1 append: ')'] printon: t1 indent: t2 precedence: t3 forValue: t4 decompiler: t5 [[t3  2  [t1 append: '(']]. left printon: t1 indent: t2 precedence: 2 forValue: true decompiler: t5. t1 append: ' and '. right printon: t1 indent: t2 precedence: 2 forValue: t4 decompiler: t5. t3  2  [t1 append: ')']] sizeForEffect: t1 [rightSize _ right sizeForEffect: 1. left sizeForValue + rightSize bfpSize + rightSize] sizeForTruth: t1 falsity: t2 [rightSize _ right sizeForTruth: t1 falsity: t2. (left sizeForTruth: 0 falsity: rightSize + t2) + rightSize] sizeForValue [rightSize _ right sizeForValue + 1. left sizeForValue + rightSize bfpSize + rightSize + 1] Class new title: ParsedDisjunct subclassof: Object fields: 'left right rightSize' declare: ''; sharing: ByteCodes emitForEffect: t1 on: t2 [left emitForValue: t1 on: t2. rightSize jmpSize emitBfp: t1 on: t2. rightSize emitJmp: t1 on: t2. right emitForEffect: t1 on: t2] emitForTruth: t1 falsity: t2 into: t3 on: t4 [left emitForTruth: rightSize + t1 falsity: 0 into: t3 on: t4. right emitForTruth: t1 falsity: t2 into: t3 on: t4] emitForValue: t1 on: t2 [left emitForValue: t1 on: t2. 1 + rightSize jmpSize emitBfp: t1 on: t2. t1 next_ toLoadTrue. rightSize emitJmp: t1 on: t2. right emitForValue: t1 on: t2] emittedReceiver [left] emittedReceiver_ t1 [left _ t1] findMacros: t1 compilerTemps: t2 [left findMacros: t1 compilerTemps: t2. right findMacros: t1 compilerTemps: t2] firstPush [left firstPush] left: t1 right: t2 [left _ t1. right _ t2] printon: t1 [t1 append: '('. t1 print: left. t1 append: ' or '. t1 print: right. t1 append: ')'] printon: t1 indent: t2 precedence: t3 forValue: t4 decompiler: t5 [[t3  2  [t1 append: '(']]. left printon: t1 indent: t2 precedence: 2 forValue: true decompiler: t5. t1 append: ' or '. right printon: t1 indent: t2 precedence: 2 forValue: t4 decompiler: t5. t3  2  [t1 append: ')']] sizeForEffect: t1 [rightSize _ right sizeForEffect: 1. left sizeForValue + 1 + rightSize jmpSize + rightSize] sizeForTruth: t1 falsity: t2 [rightSize _ right sizeForTruth: t1 falsity: t2. (left sizeForTruth: rightSize + t1 falsity: 0) + rightSize] sizeForValue [rightSize _ right sizeForValue. left sizeForValue + 2 + rightSize jmpSize + rightSize] Class new title: ParsedForLoop subclassof: Object fields: 'var source start stop step doExpr nStatements' declare: ''; sharing: ByteCodes block: t1 loc: t2 decompiler: t3 | t4 t5 t6 t7 [t4 _ t1  t2. t1  (t2 + 1) is: ParsedLoop  [nStatements _ 2. t6 _ t1  (t2 + 1). var _ t6 whileExpr  2. doExpr _ t6 doExpr. t7 _ t4 expr rcvr. (t7 is: ParsedMessage) and (t3 selector: t7 op)  to:by:  [start _ t7 rcvr. stop _ t7 args  1. step _ t7 args  2] source _ t7] nStatements _ 3. t5 _ t1  (t2 + 1). t6 _ t1  (t2 + 2). var _ t5 var. start _ [t5 expr  toLoad0  [toLoad1] t5 expr rcvr]. stop _ t4 expr. step _ toLoad1. doExpr _ t6 doExpr] nStatements [nStatements] printon: t1 indent: t2 precedence: t3 forValue: t4 decompiler: t5 [source  nil  [t1 append: 'for '. var printon: t1 indent: t2 precedence: 2 forValue: true decompiler: t5. [start  toLoad1  [] t1 append: ' from: '. start printon: t1 indent: t2 precedence: 2 forValue: true decompiler: t5]. t1 append: ' to: '. stop printon: t1 indent: t2 precedence: 2 forValue: true decompiler: t5. [step  toLoad1  [] t1 append: ' by: '. step printon: t1 indent: t2 precedence: 2 forValue: true decompiler: t5]. t1 append: ' do'. t1 crtab: t2 + 1. doExpr printon: t1 indent: t2 + 1 precedence: 0 forValue: false decompiler: t5] t1 append: 'for '. var printon: t1 indent: t2 precedence: 2 forValue: true decompiler: t5. t1 append: ' from: '. source printon: t1 indent: t2 precedence: 2 forValue: true decompiler: t5. t1 append: ' do'. t1 crtab: t2 + 1. doExpr printon: t1 indent: t2 + 1 precedence: 0 forValue: false decompiler: t5] Class new title: ParsedLoop subclassof: Object fields: 'whileExpr doExpr whileSize doSize' declare: ''; sharing: ByteCodes doExpr [doExpr] emitForEffect: t1 on: t2 [whileExpr emitForValue: t1 on: t2. doSize emitBfp: t1 on: t2. doExpr emitForEffect: t1 on: t2. 0 - doSize - whileSize - doSize jmpSize emitJmp: t1 on: t2] emitForValue: t1 on: t2 [self emitForEffect: t1 on: t2. toLoadNil emitForValue: t1 on: t2] findMacros: t1 compilerTemps: t2 [whileExpr findMacros: t1 compilerTemps: t2. doExpr findMacros: t1 compilerTemps: t2] firstPush [whileExpr firstPush] printon: t1 [t1 append: 'while '. t1 print: whileExpr. t1 append: 'do '. t1 print: doExpr] printon: t1 indent: t2 precedence: t3 forValue: t4 decompiler: t5 [[whileExpr is: ParsedNegation  [t1 append: 'until '. whileExpr negated printon: t1 indent: t2 precedence: 2 forValue: true decompiler: t5] t1 append: 'while '. whileExpr printon: t1 indent: t2 precedence: 2 forValue: true decompiler: t5]. t1 append: ' do'. t1 crtab: t2 + 1. doExpr printon: t1 indent: t2 + 1 precedence: 0 forValue: false decompiler: t5] sizeForEffect: t1 [doSize _ (doExpr sizeForEffect: 1) + 2. whileSize _ whileExpr sizeForValue. whileSize + doSize + doSize jmpSize] sizeForValue [(self sizeForEffect: 1) + 1] whileExpr [whileExpr] whileExpr: t1 doExpr: t2 [whileExpr _ t1. doExpr _ t2] Class new title: ParsedMessage subclassof: Object fields: 'rcvr op args "false if no args, Vector if many args" hasPC' declare: ''; sharing: ByteCodes args [args] args_ t1 [args _ t1] emitForEffect: t1 on: t2 [self emitForValue: t1 on: t2. t1 next_ toPop. t2 pop: 1] emitForValue: t1 on: t2 [args emitForValue: t1 on: t2. rcvr emitForValue: t1 on: t2. [rcvr  toSuper  [t1 next_ rcvr]]. op emitBytes: t1. args argsOff: t2] emittedReceiver [rcvr] emittedReceiver_ t1 [rcvr _ t1] findMacros: t1 compilerTemps: t2 | t3 t4 [t3 _ [args  nil  [()] args is: Vector  [args] args inVector]. for t4 from: t3 do [t4 findMacros: t1 compilerTemps: t2]. rcvr findMacros: t1 compilerTemps: t2] firstPush [[args  [args] rcvr] firstPush] hasPC [hasPC _ true] op [op] printon: t1 [t1 append: '('. t1 print: rcvr. t1 space. t1 print: op. [args  [t1 space. t1 print: args]]. t1 append: ')'] printon: t1 indent: t2 precedence: t3 forValue: t4 decompiler: t5 | t6 t7 t8 t9 t10 t11 t12 [t6 _ t5 selector: op. t10 _ [t6 isinfix  [3] t6 iskeyword  [2] t6 isarrow  [1] 4]. t9 _ t10 < t3 or (t3 = 2 and t10 = 2). [t9  [t1 append: '(']]. t12 _ t1 position. rcvr printon: t1 indent: t2 precedence: t10 forValue: true decompiler: t5. [t10 = 4  [t1 space. t1 append: t6] t7 _ t6 keywords. t11 _ [args  nil  [()] args is: Vector  [args] args inVector]. for t8 to: t7 length do [t1 space. t1 append: t7  t8. t1 space. t11  t8 printon: t1 indent: t2 precedence: [t10 = 3  [4] t10] forValue: true decompiler: t5]]. [hasPC  [t5 highlight: (t12 + 1 to: t1 position + 1)]]. t9  [t1 append: ')']] rcvr [rcvr] rcvr: t1 op: t2 args: t3 [rcvr _ t1. op _ t2. args _ t3. hasPC _ false. op = toEq and (toLoadFalse  rcvr or toLoadFalse  args)  [ParsedNegation new rcvr: rcvr op: op args: args]] sizeForEffect: t1 [self sizeForValue + 1] sizeForValue [args sizeForValue + rcvr sizeForValue + op sizeForValue + [rcvr  toSuper  [1] 0]] Class new title: ParsedNegation subclassof: ParsedMessage fields: '' declare: ''; sharing: ByteCodes emitForTruth: t1 falsity: t2 into: t3 on: t4 [[toLoadFalse  rcvr  [args] rcvr] emitForTruth: t2 falsity: t1 into: t3 on: t4] negated [toLoadFalse  rcvr  [args] rcvr] printon: t1 [t1 append: '(negation)'. super printon: t1] rcvr: t1 op: t2 args: t3 [rcvr _ t1. op _ t2. args _ t3] sizeForTruth: t1 falsity: t2 [[toLoadFalse  rcvr  [args] rcvr] sizeForTruth: t2 falsity: t1] Class new title: ParsedRemote subclassof: Object fields: 'expr esize toRemoteCopy' declare: ''; sharing: ByteCodes emitForValue: t1 on: t2 [toLoadThisCtxt emitForValue: t1 on: t2. toRemoteCopy emitBytes: t1. t1 emitLong: toLongJmp by: esize. expr emitForValue: t1 on: t2. t1 next_ toEnd. t2 pop: 1. 0 - esize emitJmp: t1 on: t2] expr: t1 [expr _ t1] findMacros: t1 compilerTemps: t2 [expr findMacros: t1 compilerTemps: t2] local [expr] printon: t1 [t1 append: ''. t1 print: expr] printon: t1 indent: t2 precedence: t3 forValue: t4 decompiler: t5 [[(expr is: ParsedBlock) and (expr position > 1 or (expr  1 is: ParsedConditional))  [t1 crtab: t2 + 1]]. expr printon: t1 indent: t2 + 1 precedence: t3 forValue: true decompiler: t5] remote: t1 [toRemoteCopy _ t1 encodeSel: remoteCopy] sizeForValue [esize _ expr sizeForValue + 3. esize + toRemoteCopy sizeForValue + 3] Class new title: Parser subclassof: Object fields: 'source dest oppositeCourt type token mark keep' declare: ''; sharing: TokenCodes advance | t1 [mark _ source position - [type > aBinary  [1] 0]. NoteTaker  [t1 _ oppositeCourt. oppositeCourt _ thisContext. t1 eval] oppositeCourt _ thisContext swapSender: oppositeCourt] alternatives: t1 | t2 t3 [self advance. type  aLeftBrack  [self notify: 'EXPECTED A [BLOCK]'] t2 _ self block: dest block. t3 _ dest block. [type = aSemicolon  [self cascade: t3 after: t1] self statements: t3]. dest ifExpr: t1 thenExpr: t2 elseExpr: t3] begin [mark _ source position. type _ 1. (Reader new of: source) readInto: self] binaryMessage: t1 assign: t2 | t3 t4 t5 t6 [t3 _ token. self advance. t4 _ [type = aLeftBrack  [self block: dest block] self factor]. [t2 and type = aLeftArrow  [self advance. t5 _ Vector new: 2. t5  1 _ t4. t5  2 _ self expression. t4 _ t5 itself. t6 _ String new: 2. t6  1 _ t3. t6  2 _ 95. t3 _ t6 itself]]. dest rcvr: t1 selector: t3 args: t4] block: t1 [self advance. self statements: t1. type = aRightBrack  [self advance. t1] self notify: 'PERIOD OR RIGHT BRACKET WAS EXPECTED'] body: t1 | t2 [type = aLeftBrack  [self block: t1. [type = aKeyword and token = 'primitive:'  [self advance. type = aNumber  [t2 _ token. self advance. t2] self notify: 'EXPECTED A NUMBER']]. 0] 0] cascade: t1 after: t2 | t3 t4 t5 [t4 _ dest receivingVar: t2. t5 _ dest balance. while type = aSemicolon do [self advance. t3 _ self messageChain: t4. t3  t4  [self notify: 'MESSAGE EXPECTED'] type = aCondArrow  [t1 next_ self alternatives: t3. dest unbalance: t5. self] t1 next_ t3]. dest unbalance: t5] comment: t1 [mark _ source position] contents [type _ 0. mark _ source position + 1. [NoteTaker  [] thisContext sender_ nil]. while true do [self resume. self notify: 'MORE EXPECTED']] declaration: t1 [type  aWord  [self notify: 'EXPECTED AN ARGUMENT NAME'] dest declaration: t1 name: token asArg: true. self advance] expression | t1 [type = aLeftBrack  [self block: dest block] type = aKeyword  [self macro: dest block] type  aWord  [self messageChain: self primary] t1 _ dest variable: token. self advance. type  aLeftArrow  [self messageChain: t1] self advance. dest assignment: t1 expr: self expression] factor | t1 [t1 _ self primary. while type = aWord do [t1 _ self unaryMessage: t1 assign: false]. t1] float: t1 fraction: t2 exp: t3 [token _ (t1 + '.' + t2 + 'e' + t3) asFloat. type _ aNumber. self resume] from: t1 to: t2 | t3 [source _ t1. dest _ t2. oppositeCourt _ thisContext. NoteTaker  [t3 _ Process new: 1000. t3 init. t3 send: begin to: self. t3 eval] self begin] identifier: t1 [token _ t1. type _ aWord. self resume] integer: t1 [token _ t1 asInteger. type _ aNumber. self resume] keyword: t1 [token _ t1. type _ aKeyword. self resume] keywordMessage: t1 macro: t2 | t3 t4 t5 [t3 _ Stream default. t4 _ (Vector new: 4) asStream. while type = aKeyword do [t3 append: token. self advance. t5 _ [type = aLeftBrack  [self block: dest block] self term]. t4 next_ [t3 last = 3  [dest noEvalKeyword: t5] dest evalKeyword: t5]]. [type = aLeftArrow  [t3 append: '_'. self advance. t4 next_ self expression]]. t3 _ t3 contents. t4 _ [t4 position = 1  [t4 last] t4 contents]. t2  [dest macro: t2 selector: t3 args: t4] dest keywordMessage: t1 selector: t3 args: t4] leftparen [type _ aLeftPar. self resume] literal | t1 t2 [[type = aLeftPar  [t2 _ mark. self advance. t1 _ self read. type = aRightPar  [self advance. t1] mark _ t2. self notify: 'UNMATCHED']]. t1 _ [type  aKeyword  [token unique] type  aBinary  [UST1  (token + 1)] token]. self advance. t1] loopStmt: t1 | t2 [t2 _ mark. self keywordMessage: false loop: t1  [self] mark _ t2. self notify: 'UNKNOWN CONTROL MESSAGE'] macro: t1 | t2 t3 t4 [t2 _ mark. t3 _ dest juggle. t4 _ self keywordMessage: false macro: t1. dest unjuggle: t3. t4  [t1] mark _ t2. self notify: 'UNKNOWN CONTROL MESSAGE'] messageChain: t1 [while type = aWord do [t1 _ self unaryMessage: t1 assign: true]. while type = aBinary do [t1 _ self binaryMessage: t1 assign: true]. [type = aKeyword  [t1 _ self keywordMessage: t1 macro: false]]. t1] mustBeDone [type = 0  [self terminate] self notify: 'UNEXPECTED CONSTRUCT'] notify: t1 | t2 [source skip: mark - source position. t2 _ (9 10 12 13 32 ). while (t2 has: source peek) do [source next]. [source myend  false  [source skip: 1]]. dest abortWith: t1] onechar: t1 [token _ t1. type _ [token = 46  [aPeriod] token = 91  [aLeftBrack] token = 93  [aRightBrack] token = 27  [aCondArrow] token = 95  [aLeftArrow] token = 17  [aReturnArrow] token = 59  [aSemicolon] token = 15  [aHand] aBinary]. self resume] otheratom: t1 [token _ t1. type _ aGibberish. self resume] pattern: t1 | t2 [t2 _ Stream default. [type = aWord  [t2 append: token. self advance] type = aBinary  [t2 append: UST1  (token + 1). self advance. self declaration: t1] while type = aKeyword do [t2 append: token. self advance. self declaration: t1]. t2 empty  [self notify: 'EXPECTED A SELECTOR']]. [type = aLeftArrow  [t2 append: '_'. self advance. self declaration: t1]]. t2 contents unique] primary | t1 [type = aWord  [t1 _ dest variable: token. self advance. t1] type = aLeftPar  [self subExpression] type = aNumber  [t1 _ dest literal: token. self advance. t1] type = aString  [t1 _ dest literal: token. self advance. t1] type = aHand  [self advance. type = aRightPar or type = 0  [self notify: 'EXPECTED LITERAL'] dest literal: self literal] self notify: 'OBJECT EXPECTED'] read | t1 [t1 _ (Vector new: 10) asStream. until (type = aRightPar or type = 0) do [t1 next_ self literal]. t1 contents] resume | t1 [NoteTaker  [t1 _ oppositeCourt. oppositeCourt _ thisContext. t1 eval] oppositeCourt _ thisContext swapSender: oppositeCourt] rightparen [type _ aRightPar. self resume] separator: t1 [] statement: t1 | t2 [type = aReturnArrow  [self advance. t1 next_ self expression. t1 doesReturn. [type = aPeriod  [self advance]]. type  aRightBrack  [self notify: 'SHOULDN''T FOLLOW RETURN']] type = aKeyword  [self macro: t1. type > aPeriod  [self statement: t1]] type  aPeriod  [dest nullStatement: t1] t2 _ self expression. type = aCondArrow  [t1 next_ self alternatives: t2] t1 next_ t2. type = aSemicolon  [self cascade: t1 after: t2]] statements: t1 [self statement: t1. while type = aPeriod do [self advance. self statement: t1]] string: t1 [token _ t1. type _ aString. self resume] subExpression | t1 [self advance. t1 _ self expression. type = aRightPar  [self advance. t1] self notify: 'NOT EXPECTED IN A (SUBEXPRESSION)'] temporaries: t1 [type = aBinary and token = 124  [self advance. while type = aWord do [dest declaration: t1 name: token asArg: false. self advance]]] term | t1 [t1 _ self factor. while type = aBinary do [t1 _ self binaryMessage: t1 assign: false]. t1] terminate [[dest  nil  [] dest terminate. dest _ nil]. oppositeCourt  nil  [] [NoteTaker  [] oppositeCourt release]. oppositeCourt _ nil] trailer: t1 [mark _ source position] unaryMessage: t1 assign: t2 | t3 t4 [t3 _ token. self advance. t4 _ (t2 and type = aLeftArrow) and [t3 _ t3 + '_'. self advance. self expression]. dest rcvr: t1 selector: t3 args: t4] Class new title: Point subclassof: Object fields: 'x y' declare: ''  t1 [x  t1 x and y  t1 y]  t1 [x  t1 x and y  t1 y] * t1 [Point new x: x * t1 asPtX y: y * t1 asPtY] + t1 [Point new x: x + t1 asPtX y: y + t1 asPtY] - t1 [Point new x: x - t1 asPtX y: y - t1 asPtY] / t1 [Point new x: x / t1 asPtX y: y / t1 asPtY] < t1 [x < t1 x and y < t1 y] = t1 [x = t1 x and y = t1 y] > t1 [x > t1 x and y > t1 y] abs [Point new x: x abs y: y abs] asPoint asPtX [x] asPtY [y] asRectCorner asRectOrigin asRectangle [self rect: self] copy [x  y] corner [self + (1  1)] dist: t1 | t2 [t2 _ (t1 - self) abs. t2 x + t2 y] extent [1  1] extent: t1 [Rectangle new origin: self extent: t1] fromPress: t1 value: t2 [x _ t2 nextword. y _ t2 nextword] height [1] hideData: t1 | t2 t3 [t2 _ String new: 4. t3 _ Stream new. t3 of: t2. t3 nextPoint_ self. t2] hidePress: t1 complete: t2 [t1 skipcode: self pressCode data: (self hideData: t2)] length [(x asFloat * x asFloat + (y asFloat * y asFloat)) sqrt] max: t1 [Point new x: (x max: t1 x) y: (y max: t1 y)] min: t1 [Point new x: (x min: t1 x) y: (y min: t1 y)] normal | t1 [t1 _ y asFloat neg  x asFloat. t1 / t1 length] normalize [self x_ 0. self y_ 0] origin pressCode [7] printon: t1 [t1 print: x. t1 append: ''. t1 print: y] rect: t1 [Rectangle new origin: self corner: t1] theta | t1 t2 [x = 0  [y  0  [90.0] 270.0] t1 _ y asFloat / x asFloat. t2 _ t1 arctan. x  0  [y  0  [t2] 360.0 + t2] 180.0 + t2] translate: t1 [x _ x + t1 x. y _ y + t1 y] width [1] x [x] x: t1 y: t2 [x _ t1. y _ t2] x_ t1 [x _ t1] y [y] y_ t1 [y _ t1] | t1 [Point new x: x | t1 y: y | t1] Class new title: Process subclassof: Object fields: 'minsize maxused top restartCode stack' declare: '' current [ProcessFrame new from: self] eval [user croak] primitive: 26 goBaby [NoteTaker _ true. MethodKeeper _ (Vector new: 10) asStream. externalViews _ Set new vector: 10. [Dorado  [user currentDisplay: (Form new extent: 640  760 bits: (String new: 640 * 760 / 8) offset: nil)] DefaultTextStyle NoteTakerize. user currentDisplay: (Form new extent: 640  400 bits: (String new: 640 * 400 / 8) offset: nil)]. while true do [self run]] hash [self asOop] init [[NoteTaker  [minsize _ 128. self length < minsize  [user notify: 'Processess too small.']] minsize _ 128. stack _ Vector new: 1000]. maxused _ 0. top _ 1] push: t1 | t2 [NoteTaker  [top _ top + 1. t2 _ self length - top. self  t2 _ t1] top _ top + 1. t2 _ stack length - top. stack  t2 _ t1] remoteCopy [user croak] primitive: 25 restart [restartCode eval] run [self setRestart [nil]. user restore. user run] send: t1 to: t2 | t3 t4 [t4 _ t2 class. until (t4 md has: t1) do [t4 _ t4 superclass. t4  nil  [user notify: 'message not understood:' + t1]]. self push: t2. self push: t4. t3 _ t4 method: t1. self push: t3. self push: 0. self push: 0. self push: 0. self push: [NoteTaker  [t3 initialPC + 1] t3  6 - 2]. self push: 1] setRestart t1 [restartCode _ t1] topFrame Class new title: ProcessFrame subclassof: Object fields: ' process bp ' declare: 'dOffsetTemps dOffsetBPDelta dOffsetCallersPC dOffsetNrArgs dOffsetMethod dOffsetReceiver dOffsetArgs dOffsetMethodClass ' arguments | t1 t2 t3 t4 [t1 _ self nargs. t2 _ Vector new: t1. t3 _ bp + dOffsetArgs + t1. for t4 to: t1 do [t2  t4 _ process  (t3 - t4)]. t2] bp [bp] bpCaller [self hasCaller  [bp + (process  (bp + dOffsetBPDelta))] nil] caller [self hasCaller  [ProcessFrame new process: process bp: self callerBP] nil] callerBP [self hasCaller  [bp + (process  (bp + dOffsetBPDelta)) + 1] nil] callerPC [self hasCaller  [process  (bp + dOffsetCallersPC) - 2] nil] classInit [dOffsetTemps _ 1. dOffsetBPDelta _ 0. dOffsetCallersPC _ 1. dOffsetNrArgs _ 2. dOffsetMethod _ 3. dOffsetMethodClass _ 4. dOffsetReceiver _ 5. dOffsetArgs _ 6] climb [bp _ self callerBP] from: t1 [process _ t1. bp _ process length - process remoteCopy frameOffset + 1. self climb. self climb] hasCaller [process  (bp + dOffsetBPDelta) = 0  [false] true] mclass [process  (bp + dOffsetMethodClass)] message | t1 t2 [self hasCaller  [t1 _ process  (self callerBP + dOffsetMethod). t1 messageAt: self callerPC] XXnoCallerXX] method [process  (bp + dOffsetMethod)] nargs [process  (bp + dOffsetNrArgs)] pc | t1 [t1 _ self successor. t1  nil  [nil] t1 callerPC] printon: t1 [t1 append: self mclass title. self hasCaller  [[self receiver is: self mclass  [] t1 append: '(' + self receiver class title + ')']. t1 append: ' <= '. t1 print: self message]] process: t1 bp: t2 [process _ t1. bp _ t2] receiver [process  (bp + dOffsetReceiver)] sender [self caller] stack | t1 t2 [t1 _ Stream new of: (Vector new: 20). t2 _ self. t1 next_ self. while t2 hasCaller do [t2 _ t2 caller. t1 next_ t2]. t1 contents] successor | t1 t2 [t1 _ thisContext current bp. t2 _ bp - 1. while t2  t1 do [[process  (t2 + dOffsetBPDelta) is: Integer  [process  (t2 + dOffsetBPDelta) = (bp - t2 - 1)  [process  (t2 + dOffsetCallersPC) is: Integer  [process  (t2 + dOffsetNrArgs) is: Integer  [process  (t2 + dOffsetMethod) is: CompiledMethod  [process  (t2 + dOffsetMethodClass) is: Class  [ProcessFrame new process: process bp: t2]]]]]]]. t2 _ t2 - 1]. nil] tempframe | t1 t2 t3 t4 t5 [t1 _ self nargs. t2 _ self method numTemps. t3 _ Vector new: t1 + t2. t4 _ bp + dOffsetArgs + t1. for t5 to: t1 do [t3  t5 _ process  (t4 - t5)]. t4 _ bp + dOffsetTemps + 1. for t5 to: t2 do [t3  t5 _ process  (t4 - t5)]. t3] temps | t1 t2 t3 t4 [t1 _ self method numTemps. t2 _ Vector new: t1. t3 _ bp + dOffsetTemps + 1. for t4 to: t1 do [t2  t4 _ process  (t3 - t4)]. t2] thisop [self successor message] trace | t1 t2 [while self hasCaller do [t1 _ self receiver class. [t1 = self mclass  [t2 _ ' '] t2 _ '(' + t1 title + ') ']. user show: self mclass title + t2 + self message. user cr. self climb]] variableNamesInto: t1 with: t2 | t3 t4 t5 [t3 _ self mclass. t4 _ t3 md invert: self method. t4  [t5 _ Parser new from: (t3 code: t4) asStream to: t1. t5 pattern: t2. t5 temporaries: t2. t5 terminate] t1 notify: 'thisContext is not running a currently defined method'] Class new title: ProjectWindow subclassof: Window fields: 'userview parent changes' declare: 'actionMenu ' classInit [actionMenu _ Menu new string: 'enter'] close [parent _ nil. userview _ parent] init [self userview: (user copyIn: self) changes: HashSet init parent: user projectWindow. self newframe. self show] install [Changes _ changes. user _ userview. user install. self putTitle. user restart] putTitle [[titlepara  nil  [titlepara _ 'Top View' asParagraph allBold]]. titleframe put: titlepara centered: user screenrect extent x / 3  8. titleframe outline] runParent [parent install] userview: t1 changes: t2 parent: t3 [userview _ t1. changes _ t2. parent _ t3] yellowbug [actionMenu bug = 1  [self install]] Class new title: Reader subclassof: Object fields: 'source collector token nextchar typetbl ' declare: 'typetable ' classInit | t1 t2 t3 t4 t5 [typetable _ String new: 256. t1 _ Stream new of: (5 0 255 1 65 90 1 97 122 2 48 57 3 58 58 3 3 3 4 9 10 4 12 13 4 32 32 6 34 34 6 25 25 7 39 39 8 21 21 9 26 26 10 30 30 11 40 41 ). while [t2 _ t1 next. t2] do [t3 _ t1 next. t4 _ t1 next. for t5 from: (t3 + 1 to: t4 + 1) do [typetable  t5 _ t2]]] of: t1 [typetbl _ typetable. token _ Stream default. source _ t1 asStream. self step] rdint: t1 [token reset. [nextchar = t1  [token next_ t1. self step]]. while nextchar do [nextchar < 48  [token contents] [nextchar > 57  [nextchar > 72  [token contents] nextchar < 65  [token contents] token next_ nextchar. nextchar _ source next]]. token next_ nextchar. nextchar _ source next]. token contents] read [self readInto: TokenCollector default] readInto: t1 | t2 [collector _ t1. while nextchar do [t2 _ typetbl  (nextchar + 1). t2 = 4  [collector separator: nextchar. nextchar _ source next] t2 = 1  [self readatom: 0] t2 = 5  [collector onechar: nextchar. nextchar _ source next] t2 = 6  [self upto: nextchar  [collector notify: 'Unmatched comment quote'] collector comment: token contents] t2 = 2  [self readnum] t2 = 11  [[nextchar = 40  [collector leftparen] collector rightparen]. nextchar _ source next] t2 = 7  [self upto: nextchar  [collector notify: 'Unmatched string quote'] collector string: token contents] t2 = 8  [self readnum] t2 = 9  [self upto: 13  [collector notify: '^Z without CR'] collector trailer: token contents] t2 = 10  [collector contents] t2 = 3  [self readatom: 1]]. collector contents] readatom: t1 | t2 t3 t4 [token reset. while [token next_ nextchar. nextchar _ source next. nextchar and [t2 _ typetbl  (nextchar + 1). t2  3]] do [t2 = 3  [t1 _ t1 + 1]]. t3 _ token contents. t1 = 0  [collector identifier: t3] t1 > 1  [collector otheratom: t3] t3 length = 1  [collector otheratom: t3] t4 _ t3  t3 length. t4 = 58  [collector keyword: t3] t4 = 3  [collector keyword: t3] collector otheratom: t3] readnum | t1 t2 t3 [t1 _ self rdint: 21. nextchar = 46  [self step. nextchar  false or nextchar isdigit  false  [collector integer: t1. collector onechar: 46] t2 _ self rdint: 1. [nextchar = 101  [self step. t3 _ self rdint: 21] t3 _ '']. collector float: t1 fraction: t2 exp: t3] collector integer: t1] step [nextchar _ source next] upto: t1 | t2 [t2 _ source position. token reset. while [nextchar _ source next. nextchar] do [[nextchar = t1  [self step. t1  39  [false] nextchar  39  [false]]]. token next_ nextchar]. source skip: t2 - 1 - source position. true] Class new title: Rectangle subclassof: Object fields: 'origin corner' declare: '' * t1 [Rectangle new origin: origin * t1 asRectOrigin corner: corner * t1 asRectCorner] + t1 [Rectangle new origin: origin + t1 asRectOrigin corner: corner + t1 asRectCorner] - t1 [Rectangle new origin: origin - t1 asRectOrigin corner: corner - t1 asRectCorner] / t1 [Rectangle new origin: origin / t1 asRectOrigin corner: corner / t1 asRectCorner] = t1 [origin = t1 origin and: corner = t1 corner] ALTObitsFromString: t1 mode: t2 [user croak] primitive: 53 ALTObitsIntoString: t1 mode: t2 [user croak] primitive: 53 ALTOblt: t1 mode: t2 [user croak] primitive: 53 ALTObltcomp: t1 mode: t2 [user croak] primitive: 53 ALTObrush: t1 mode: t2 color: t3 [user croak] primitive: 53 ALTOcolor: t1 mode: t2 [user croak] primitive: 53 area [self width * self height] asRectCorner [corner] asRectOrigin [origin] asRectangle bitStringLength | t1 [t1 _ corner - origin. 2 * t1 y * (t1 x + 15 / 16)] bitsFromStream: t1 | t2 t3 [t2 _ origin rect: origin + (self width  (16 min: self height)). t3 _ String new: t2 bitStringLength. while t2 maxY  corner y do [t1 into: t3. t2 bitsFromString: t3. t2 moveby: 0  16]. t2 minY < corner y  [t2 corner y_ corner y. t3 _ nil. t3 _ String new: t2 bitStringLength. t1 into: t3. t2 bitsFromString: t3]] bitsFromString: t1 [self bitsFromString: t1 mode: storing] bitsFromString: t1 mode: t2 | t3 [NoteTaker  [t3 _ BitBlt new toDisplay. t3 function_ t2. t3 sourceForm_ Form new extent: corner - origin bits: t1 offset: nil. t3 dest_ origin. t3 extent_ corner - origin. t3 source_ 0  0. t3 callBLT] self ALTObitsFromString: t1 mode: t2] bitsFromString: t1 mode: t2 clippedBy: t3 | t4 t5 t6 [NoteTaker  [t5 _ BitBlt new toDisplay window: t3. t5 function_ t2. t5 sourceForm_ Form new extent: corner - origin bits: t1 offset: nil. t5 dest_ origin. t5 extent_ corner - origin. t5 source_ 0  0. t5 callBLT] self bitStringLength  t1 length  [user notify: 'wrong bit string length'] t4 _ self intersect: user screenrect. [nil  t3  [] t4 _ t4 intersect: t3]. t6 _ BitBlt init. t6 destbase_ mem  54. t6 destraster_ user screenrect width / 16 | 2. t6 dest_ t4 origin. t6 extent_ t4 extent. t6 sourceraster_ corner x - origin x + 15 / 16. t6 source_ t4 origin - origin. t6 sourcebase_ t1. t6 copy: t2] bitsIntoString | t1 [t1 _ String new: self bitStringLength. self bitsIntoString: t1 mode: storing. t1] bitsIntoString: t1 [self bitsIntoString: t1 mode: storing] bitsIntoString: t1 mode: t2 | t3 [NoteTaker  [t3 _ BitBlt new fromDisplay. t3 function_ t2. t3 destForm_ Form new extent: corner - origin bits: t1 offset: nil. t3 dest_ 0  0. t3 extent_ corner - origin. t3 source_ origin. t3 callBLT] self ALTObitsIntoString: t1 mode: t2] bitsIntoString: t1 mode: t2 clippedBy: t3 | t4 t5 t6 [NoteTaker  [t5 _ BitBlt new fromDisplay window: t3. t5 function_ t2. t5 destForm_ Form new extent: corner - origin bits: t1 offset: nil. t5 dest_ 0  0. t5 extent_ corner - origin. t5 source_ origin. t5 callBLT] self bitStringLength  t1 length  [user notify: 'wrong bit string length'] t4 _ self intersect: user screenrect. [t3  nil  [] t4 _ t4 intersect: t3]. t6 _ BitBlt init. t6 destraster_ corner x - origin x + 15 / 16. t6 dest_ t4 origin - origin. t6 extent_ t4 extent. t6 sourcebase_ mem  54. t6 sourceraster_ user screenrect width / 16 | 2. t6 source_ t4 origin. t6 destbase_ t1. t6 copy: t2] bitsOntoStream: t1 | t2 t3 [t2 _ origin rect: origin + (self width  (16 min: self height)). t3 _ String new: t2 bitStringLength all_ 0. while t2 maxY  corner y do [t2 bitsIntoString: t3. t2 moveby: 0  16. t1 append: t3]. t2 minY < corner y  [t2 bitsIntoString: t3. t1 append: t3  (1 to: t3 length / t2 height * (corner y - t2 minY))]] blowup: t1 by: t2 | t3 t4 [t4 _ Rectangle new origin: t1 extent: self extent * t2. [(t4 has: origin) or: (t4 has: corner)  [t3 _ self bitsIntoString. t4 outline. self moveto: t4 origin. self bitsFromString: t3] t4 outline]. self blowup: t1 by: t2 spacing: 1] blowup: t1 by: t2 spacing: t3 | t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 [t4 _ self extent. t2 _ t2 asPoint. t3 _ t3 asPoint. t11 _ Rectangle new origin: t1 extent: t4 * t2. t5 _ 1  0. t9 _ t4 x. t10 _ 0  t4 y. t14 _ (t2 - t3) x. for t12 to: 2 do [t6 _ t5 * 1. t7 _ t5 * t2. t8 _ Rectangle new origin: t5 * t9 + [t12 = 1  [self origin] t1] extent: t5 + t10. t11 _ t1 + (t5 * (t2 * t9)). for t13 to: t9 do [t11 _ t11 - t7. t8 moveby: t6. t8 blt: t11 mode: storing]. t8 _ Rectangle new origin: t1 + t5 extent: t10 + (t5 * (t2 - 1)). for t13 to: t9 do [t8 clear: white. t8 moveby: t7]. t8 _ Rectangle new origin: t1 extent: t10 + (t5 * (t2 * t9 - 1)). for t13 to: t14 - 1 do [t8 blt: t1 + t5 mode: oring]. t5 _ 0  1. t9 _ t4 y. t10 _ (t2 * t4) x  0. t14 _ (t2 - t3) y]] blt: t1 mode: t2 [NoteTaker  [DisplayBLTer bltrect: self topt: t1 mode: (t2 land: 3) color: 0] self ALTOblt: t1 mode: t2] blt: t1 mode: t2 clippedBy: t3 | t4 t5 t6 t7 [NoteTaker  [t6 _ DisplayBLTer copy. t6 window: t3. t6 bltrect: self topt: t1 mode: (t2 land: 3) color: 0] t4 _ (Rectangle new origin: t1 extent: self extent) intersect: user screenrect. [nil  t3  [] t4 _ t4 intersect: t3]. t5 _ origin + t4 origin - t1. t7 _ BitBlt init toDisplay. t7 dest_ t4 origin. t7 extent_ t4 extent. t7 sourcebase_ mem  54. t7 sourceraster_ user screenrect width / 16 | 2. t7 source_ t5. t7 copy: t2] bltcomp: t1 mode: t2 [NoteTaker  [DisplayBLTer bltrect: self topt: t1 mode: 4 + (t2 land: 3) color: 0] self ALTObltcomp: t1 mode: t2] border: t1 color: t2 | t3 [t3 _ Rectangle new origin: origin - (t1  t1) corner: corner x + t1  origin y. t3 clear: t2. t3 moveto: origin x - t1  corner y. t3 clear: t2. t3 origin_ corner x  (origin y - t1). t3 clear: t2. t3 moveto: origin - (t1  t1). t3 clear: t2] bottom [corner y] boxcomp | t1 [t1 _ Rectangle new origin: origin - (2  2) corner: corner x + 2  origin y. t1 color: black mode: xoring. t1 moveto: origin x - 2  corner y. t1 color: black mode: xoring. t1 origin_ corner x  (origin y - 2). t1 color: black mode: xoring. t1 moveto: origin - (2  2). t1 color: black mode: xoring] brush: t1 mode: t2 color: t3 [NoteTaker  [DisplayBLTer bltrect: self topt: t1 mode: 8 + (t2 land: 3) color: t3] self ALTObrush: t1 mode: t2 color: t3] brush: t1 mode: t2 color: t3 clippedBy: t4 | t5 t6 t7 t8 [NoteTaker  [t7 _ DisplayBLTer copy. t7 window: t4. t7 bltrect: self topt: t1 mode: 8 + (t2 land: 3) color: t3] t5 _ (Rectangle new origin: t1 extent: self extent) intersect: user screenrect. [nil  t4  [] t5 _ t5 intersect: t4]. t6 _ origin + t5 origin - t1. t8 _ BitBlt init. t8 color_ t3. t8 destbase_ mem  54. t8 destraster_ user screenrect width / 16 | 2. t8 dest_ t5 origin. t8 extent_ t5 extent. t8 sourcebase_ mem  54. t8 sourceraster_ user screenrect width / 16 | 2. t8 source_ t6. t8 paint: t2] center [origin + corner / 2] clear [self color: background mode: storing] clear: t1 [self color: t1 mode: storing] color: t1 mode: t2 [NoteTaker  [DisplayBLTer bltrect: self topt: origin mode: 12 + (t2 land: 3) color: t1] self ALTOcolor: t1 mode: t2] comp [self color: black mode: xoring] comp: t1 [self color: t1 mode: xoring] copy [origin copy rect: corner copy] corner [corner] corner_ t1 [corner _ t1] corners | t1 [t1 _ Vector new: 4. t1  1 _ origin. t1  2 _ corner x  origin y. t1  3 _ corner. t1  4 _ origin x  corner y. t1] dragto: t1 | t2 t3 [self blt: t1 mode: storing. t2 _ t1 rect: t1 + self extent. for t3 from: (self minus: t2) do [t3 clear]. origin _ t1. corner _ t2 corner] edge: t1 [t1 = 0  [origin y] t1 = 1  [origin x] t1 = 2  [corner y] t1 = 3  [corner x] user notify: 'Invalid side'] empty [origin < corner  false] extent [corner - origin] extent_ t1 [corner _ origin + t1. t1] fillin: t1 mode: t2 | t3 t4 t5 t6 t7 t8 t9 [t3 _ Turtle init. t5 _ origin + (self width  0). t6 _ Rectangle new origin: t5 extent: self extent. t7 _ 1  0 , (1  0) , (0  1) , (0  1). t4 _ t6 bitsIntoString. self blt: t5 mode: storing. user waitbug. t3 place: user mp. t3 pendn. while user anybug do [t3 goto: user mp]. self blt: t5 mode: xoring. t6 blt: origin mode: xoring. user waitbug. while user anybug do [for t9 from: 0 to: 2 by: 2 do [for t8 to: 2 do [t6 blt: t7  (t9 + t8) + t5 mode: oring]. self blt: t5 mode: erasing]]. t6 brush: origin mode: t2 color: t1. t6 bitsFromString: t4] flash [self comp. self comp] fromuser | t1 [origin _ OriginCursor showwhile [user waitbug]. t1 _ origin. CornerCursor showwhile [while [corner _ t1. t1 _ user mpnext. t1] do [self comp. t1 _ t1 max: origin. self comp]. nil]] fromuserevenword | t1 [origin _ OriginCursor showwhile [user waitbug]. t1 _ origin. CornerCursor showwhile [while [corner _ t1. t1 _ user mpnext. t1] do [self comp. t1 _ t1 x + 15 | 16  t1 y max: origin. self comp]. nil]] growby: t1 [corner _ corner + t1] growto: t1 [corner _ t1] has: t1 [origin  t1 and t1 < corner] height [corner y - origin y] height_ t1 [corner y_ origin y + t1] include: t1 [(origin min: t1 origin) rect: (corner max: t1 corner)] inset: t1 [origin + t1 rect: corner - t1] inset: t1 and: t2 [origin + t1 rect: corner - t2] intersect: t1 [Rectangle new origin: (origin max: t1 origin) corner: (corner min: t1 corner)] intersects: t1 [(origin max: t1 origin) < (corner min: t1 corner)] isWithin: t1 [origin  t1 origin and corner  t1 corner] leftside [origin x] max: t1 [Rectangle new origin: (origin min: t1 origin) corner: (corner max: t1 corner)] maxX [corner x] maxY [corner y] minX [origin x] minY [origin y] minus: t1 | t2 t3 t4 [[origin  t1 corner and t1 origin  corner  [] self inVector]. t2 _ (Vector new: 4) asStream. [t1 origin y > origin y  [t3 _ t1 origin y. t2 next_ origin rect: corner x  t3] t3 _ origin y]. [t1 corner y < corner y  [t4 _ t1 corner y. t2 next_ origin x  t4 rect: corner] t4 _ corner y]. [t1 origin x > origin x  [t2 next_ origin x  t3 rect: t1 origin x  t4]]. [t1 corner x < corner x  [t2 next_ t1 corner x  t3 rect: corner x  t4]]. t2 contents] moveby: t1 [origin _ origin + t1. corner _ corner + t1] moveto: t1 [corner _ corner + t1 - origin. origin _ t1] nearest: t1 [((origin x max: t1 x) min: corner x)  ((origin y max: t1 y) min: corner y)] origin [origin] origin: t1 corner: t2 [origin _ t1. corner _ t2] origin: t1 extent: t2 [origin _ t1. corner _ origin + t2] origin_ t1 [origin _ t1] outline [self outline: 2] outline: t1 | t2 [t2 _ 1  1 * t1. (self inset: t2) clear: black. self clear: white] printon: t1 [t1 print: origin. t1 append: ' rect: '. t1 print: corner] reverse [self color: black mode: xoring] rightside [corner x] rotate | t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 [t1 _ self extent x. t3 _ t1  t1. t6 _ Rectangle new origin: origin extent: t3. t4 _ origin + (0  t1). t2 _ Rectangle new origin: t4 extent: t3. t5 _ t4 + (t1  0). t7 _ Rectangle new origin: t5 extent: t3. t8 _ 0  0 , (1  0) , (0  0) , (0  1) , (1  1) , (0  1) , (1  0) , (1  0) , (1  0). t9 _ 0  0 , (1  1) , (0  0) , (1  1) , (1  1) , (1  1). t11 _ t1 / 2. t2 clear: white. (Rectangle new origin: t4 extent: t11  t11) clear: black. until t11 < 1 do [for t10 to: 3 do [t7 clear: white. t2 blt: t8  t10 * t11 + t5 mode: storing. t2 blt: t8  (3 + t10) * t11 + t5 mode: oring. t6 bltcomp: t5 mode: erasing. t7 blt: t8  (6 + t10) * t11 + origin mode: xoring]. for t10 to: 3 do [t7 clear: white. t2 blt: t9  t10 * t11 + t5 mode: storing. t6 bltcomp: t5 mode: erasing. t7 blt: t9  (3 + t10) * t11 + origin mode: xoring]. t11 _ t11 / 2. t11 < 1  [] t2 blt: 0  t11 + t4 mode: erasing. t2 blt: t11  0 + t4 mode: erasing. t2 blt: t11 * 2  0 + t4 mode: oring. t2 blt: 0  (2 * t11) + t4 mode: oring]] side: t1 [t1 = 0  [origin rect: corner x  origin y] t1 = 1  [origin rect: origin x  corner y] t1 = 2  [origin x  corner y rect: corner] t1 = 3  [corner x  origin y rect: corner] user notify: 'Invalid side'] side: t1 distanceTo: t2 [t1 = 0  [t2 y - origin y] t1 = 1  [t2 x - origin x] t1 = 2  [corner y - t2 y] t1 = 3  [corner x - t2 x] user notify: 'Invalid side'] sideNearest: t1 | t2 t3 t4 t5 [t3 _ 32767. for t4 from: (0 to: 3) do [t2 _ self side: t4 distanceTo: t1. t3 > t2 abs  [t3 _ t2. t5 _ t4]]. t5] size [corner - origin] top [origin y] translate: t1 [origin _ origin + t1. corner _ corner + t1] translateto: t1 [self translate: t1 - origin] width [corner x - origin x] width_ t1 [corner x_ origin x + t1] withEdge: t1 at: t2 [t1 = 0  [origin x  t2 rect: corner] t1 = 1  [t2  origin y rect: corner] t1 = 2  [origin rect: corner x  t2] t1 = 3  [origin rect: t2  corner y] user notify: 'Invalid side'] withSide: t1 at: t2 [t1 = 0  [origin x  t2 y rect: corner] t1 = 1  [t2 x  origin y rect: corner] t1 = 2  [origin rect: corner x  t2 y] t1 = 3  [origin rect: t2 x  corner y] user notify: 'Invalid side'] Class new title: RemoteCode subclassof: Object fields: 'frameOffset startingPC process stackOffset' declare: '' eval [user croak] primitive: 26 frameOffset [frameOffset] value [user croak] primitive: 26 value_ t1 [user croak] primitive: 39 Class new title: RemoteParagraph subclassof: Object fields: 'file hipos lowpos' declare: '' asParagraph [file position_ self position. Paragraph new readFrom: file] asString [self asParagraph text] fromParagraph: t1 [self position_ file position. t1 storeOn: file] fromString: t1 [self fromParagraph: t1 asParagraph] on: t1 [file _ t1] position [hipos + 1000 * 2000 + (lowpos + 1000)] position_ t1 [t1 _ t1 intdiv: 2000. hipos _ (t1  1) asInteger - 1000. lowpos _ (t1  2) asInteger - 1000] Class new title: ScrollBar subclassof: Object fields: 'rect bitstr owner position' declare: 'JumpCursor UpCursor DownCursor ' boxPosition_ t1 [position moveto: rect origin + (9  (4 + ([t1 < 0.0  [0.0] t1 > 1.0  [1.0] t1] * (rect height - 16))))] classInit [UpCursor _ Cursor new fromtext: ' 1000000000000000 1100000000000000 1110000000000000 1111000000000000 1111100000000000 1111110000000000 1100000000000000 1100000000000000 1100000000000000 1100000000000000 1100000000000000 1100000000000000 1100000000000000 1100000000000000 1100000000000000 1100000000000000'. DownCursor _ Cursor new fromtext: ' 1100000000000000 1100000000000000 1100000000000000 1100000000000000 1100000000000000 1100000000000000 1100000000000000 1100000000000000 1100000000000000 1100000000000000 1111110000000000 1111100000000000 1111000000000000 1110000000000000 1100000000000000 1000000000000000'. JumpCursor _ Cursor new fromtext: ' 0111000000000000 1111100000000000 1111100000000000 0111000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000' offset: 2  1] close [owner _ nil] eachtime | t1 t2 t3 [t1 _ user mp. rect has: t1  [t2 _ rect center x - 2. t1 x < t2  [t3 _ Rectangle new origin: rect origin corner: t2  rect maxY. DownCursor showwhile [while [t1 _ user mp. t3 has: t1] do [self slide: t1  [owner scrollTo: (position minY - rect minY - 4) asFloat / (rect height - 12)] user redbug  [self reposition [owner scrollUp: rect origin y - t1 y]]]. nil]] t3 _ Rectangle new origin: t2  rect minY corner: rect corner. UpCursor showwhile [while [t1 _ user mp. t3 has: t1] do [self slide: t1  [owner scrollTo: (position minY - rect minY - 4) asFloat / (rect height - 12)] user redbug  [self reposition [owner scrollUp: t1 y - rect origin y]]]. nil]] false] firsttime [rect has: user mp] hide [bitstr  nil  [user notify: 'Attempt to hide unshown scrollbar'] rect bitsFromString: bitstr. bitstr _ nil] hidewhile t1 | t2 [self hide. t2 _ t1 eval. self show. t2] lasttime on: t1 from: t2 [self on: t1 from: t2 at: t2 scrollPos] on: t1 from: t2 at: t3 [owner _ t2. rect _ Rectangle new origin: t1 origin - (32  2) extent: 32  (t1 height + 4). position _ Rectangle new origin: rect origin + (9  4) extent: 16  8. self boxPosition_ t3] reposition t1 [self reshow [t1 eval. self boxPosition_ owner scrollPos]] reshow t1 | t2 [t2 _ position inset: 2. t1 eval. t2 clear: white. position outline] show [bitstr _ rect bitsIntoString. rect clear: black. (rect inset: 2  2 and: 1  2) clear: white. position outline] slide: t1 | t2 [position has: t1  [JumpCursor showwhile [t2 _ false. while ((position has: user mp) and t2  false) do [user redbug  [t2 _ true. while user redbug do [self reshow [position moveto: position origin x  ((user mp y max: rect origin y + 4) min: rect corner y - 12)]]]]. nil]. t2] false] Class new title: SelectorPane subclassof: ListPane fields: 'organizationPane codePane' declare: 'editmenu ' classInit [editmenu _ Menu new string: 'spawn forget'] close [organizationPane _ nil. super close] compile: t1 [organizationPane compile: t1] compile: t1 in: t2 under: t3 [codePane compile: t1 in: t2 under: t3] deselected [codePane showing: organizationPane noCode] dirty [codePane dirty] execute: t1 for: t2 [codePane _ t2. codePane execute: t1 in: false to: nil] from: t1 to: t2 [organizationPane _ t1. codePane _ t2] selected [codePane showing: (organizationPane code: list  selection)] yellowbug | t1 [selection = 0  [window flash] scrollBar hidewhile [t1 _ editmenu bug. [t1 = 1  [organizationPane spawn: list  selection with: codePane contents formerly: codePane oldContents] t1 = 2  [organizationPane forget: list  selection] nil]]] Class new title: Set subclassof: Stream fields: 'views' declare: ''  t1 [array  t1]  t1 _ t2 [position + 1 = t1  [self next_ t2] array  t1 _ t2] add: t1 [self next_ t1] append: t1 | [for t1 from: t1 do [self next_ t1]] asSet asStream [self viewer] checkIndex: t1 [t1  1 and t1  position  [t1] user notify: 'illegal index'] copy [self viewer copy] default [self vector: 8] delete: t1 | t2 [for t2 to: position do [array  t2  t1  [self deleteI: t2]]. false] deleteI: t1 | t2 t3 [t2 _ self  t1. for t3 from: t1 to: position - 1 do [array  t3 _ array  (t3 + 1)]. array  position _ nil. position _ position - 1. t2] deleteI: t1 to: t2 | t3 t4 [t3 _ t2 - t1 + 1. for t4 from: t1 to: position - t3 do [array  t4 _ array  (t4 + t3)]. for t4 from: position - t3 + 1 to: position do [array  t4 _ nil]. position _ position - t3] dotproduct: t1 | t2 t3 [t3 _ 0.0. self length = t1 length  [for t2 to: position do [t3 _ t3 + (t1  t2 * (self  t2))]. t3] user notify: 'dot product undefined...sets are not of equal length'] find: t1 | t2 [for t2 to: position do [array  t2 = t1  [t2]]. 0] grow [self growby: (10 max: limit / 4)] growby: t1 | t2 [t2 _ Set new of: array to: position. self of: (array species new: limit + t1) to: 0. t2] has: t1 [(self find: t1) > 0] initView: t1 [t1 of: array to: position] insert: t1 [(self find: t1) = 0  [self next_ t1]] insertI: t1 value: t2 | t3 t4 [t1 > position  [self next_ t2] t3 _ array. [position = limit  [limit _ limit + (10 max: limit / 4). array _ array species new: limit. for t4 to: t1 - 1 do [array  t4 _ t3  t4]]]. for t4 from: position to: t1 by: 1 do [array  t4 + 1 _ t3  t4]. array  t1 _ t2. position _ position + 1] length [position] next [user notify: 'no direct reading of a Set'] notViewed: t1 [views delete: t1. views empty  [views _ nil]] of: t1 to: t2 [array _ t1. position _ t2. limit _ array length] pastend_ t1 [self append: self grow. self next_ t1] printon: t1 | t2 [t1 append: 'a Set: '. array is: String  [t1 append: self] for t2 from: self do [t1 space. t1 print: t2]] product: t1 | t2 t3 [t2 _ Set new default. self length = t1 length  [for t3 to: position do [t2 add: t1  t3 * (self  t3)]. t2] user notify: 'product undefined...sets are not of equal length'] species [array species] string: t1 [limit _ t1. self of: (String new: limit)] summation | t1 t2 [t2 _ 0.0. for t1 to: position do [t2 _ t2 + (self  t1)]. t2] vector: t1 [limit _ t1. self of: (Vector new: limit)] viewRange: t1 to: t2 [SetReader new of: array from: t1 to: t2] viewer [SetReader new of: array from: 1 to: position] viewer: t1 [[views  nil  [views _ Set default]]. views next_ t1] Class new title: SetReader subclassof: Stream fields: '' declare: '' asSet [self copy] copy | t1 [t1 _ Set new. t1 of: (array species new: limit - position). t1 append: self] length [limit - position] of: t1 from: t2 for: t3 [array _ t1. position _ t2. position _ position - 1. limit _ position + t3] Class new title: StackPane subclassof: ListPane fields: 'contextVarPane instanceVarPane codePane variables proceed' declare: 'stackmenu ' classInit [stackmenu _ Menu new string: 'stack spawn proceed restart'] close [NoteTaker  [super close] Top enable: proceed  3. super close. list  [(list  1) releaseFully]] code | t1 t2 [t1 _ (list  selection) mclass. t2 _ self selector. (t1 canunderstand: t2) and (t1 code: t2)] comment: t1 [] compile: t1 | t2 t3 t4 t5 [t2 _ list  (selection max: 1). t5 _ t2 mclass. t3 _ codePane compile: t1 in: t5 under: 'As yet unclassified'. proceed  2 _ t3  [codePane reflects: selection  [t4 _ t5 md methodorfalse: t3. t4  [self releaseAboveSelection. t2 restartWith: t4. proceed  1 _ true. self of: list  (selection to: list length) copy. self select: 1]]]] contents context: t1 at: t2 instance: t3 code: t4 [contextVarPane _ t1. instanceVarPane _ t3. codePane _ t4. variables _ (Vector new: 16) asStream. proceed  nil  [proceed _ false , nil , t2]] context: t1 instance: t2 code: t3 [contextVarPane _ t1. instanceVarPane _ t2. codePane _ t3. variables _ (Vector new: 16) asStream. proceed  nil  [proceed _ false , nil , Top currentPriority]] continue: t1 | t2 [[selection = 0  [selection _ 1]]. t2 _ list  selection. self releaseAboveSelection. [t1  [t2 restart] proceed  1 and: selection = 1  [] t2 push: proceed  2]. list _ false. user topWindow vanish. list _ nil. Top run: t2 at: proceed  3. Top enable: proceed  3. Top wakeup: proceed  3. Top resetCurrent] declaration: t1 name: t2 asArg: t3 [variables next_ t2] deselected [contextVarPane  false  [] codePane showing: ''. contextVarPane names: (Vector new: 0) values: (nil ) wrt: false. instanceVarPane names: (Vector new: 0) values: (nil ) wrt: false] dirty [codePane and codePane dirty] execute: t1 for: t2 [codePane _ t2. proceed  2 _ codePane execute: t1 in: [selection = 0  [false] list  selection] to: nil] identifier: t1 [variables next_ t1] interrupt: t1 [proceed  1 _ t1] locked [contextVarPane and (selection > 0 and self dirty)] notify: t1 [] releaseAboveSelection [[selection > 1  [list  (selection - 1) sender_ nil. (list  1) release]]. (list  (selection max: 1)) verifyFrames] selected | t1 t2 t3 t4 [contextVarPane  false  [] t1 _ list  selection. t2 _ t1 receiver. Decompiler new findPC: t1 pc. t3 _ self code. codePane showing: [t3  [t3] '']. codePane selectRange: Decompiler new highlight. variables reset. t1 variableNamesInto: self with: nil. [t3  [contextVarPane names: ((thisContext ) concat: variables contents) values: t1 , t1 tempframe wrt: t1. t1 tempframe  nil  [user notify: 'NIL TEMPFRAME']] contextVarPane names: (thisContext ) values: t1 inVector wrt: t1]. variables reset. t2 class fieldNamesInto: self. t4 _ Vector new: 2. t4 all_ t2. instanceVarPane names: ((self ) concat: variables contents) values: t4 wrt: t1. contextVarPane select: 1] selector | t1 [t1 _ list  (selection max: 1). [t1 sender  nil  [false] t1 sender thisop]] separator: t1 [] spawn | t1 t2 t3 t4 [t1 _ (list  (selection max: 1)) mclass. t2 _ self selector. t3 _ [codePane  [codePane contents] t1 canunderstand: t2  [t1 code: t2] '']. t4 _ codePane and codePane oldContents. self compselection. self select: 0. t1 edit: t2 para: t3 formerly: t4] terminate trailer: t1 [] yellowbug | t1 [scrollBar hidewhile [t1 _ stackmenu bug. [t1 = 1  [self revise: (list  1) stack with: [selection = 0  [nil] list  selection]] t1 = 2  [self spawn] t1 = 3  [self continue: false] t1 = 4  [self continue: true] nil]]] Class new title: StackPaneNT subclassof: StackPane fields: ' ' declare: '' close [super close] context: t1 instance: t2 code: t3 [contextVarPane _ t1. instanceVarPane _ t2. codePane _ t3. variables _ Stream new of: (Vector new: 16). proceed  nil  [proceed _ false , nil , 1]] processFrame: t1 [self context: false instance: false code: false. self interrupt: false. self of: t1 inVector] Class new title: Stream subclassof: Object fields: 'array position limit' declare: ''  t1 [array  t1]  t1 _ t2 [array  t1 _ t2]  t1 | t2 [t2 _ self next. t2  [t1 = t2  [t2] position _ position - 1. false] false] append: t1 | t2 [for t2 from: t1 do [self next_ t2]. t1] asArray [array] asStream asVector [(Reader new of: self) read] close [limit _ position. position _ 0] contents [array copy: 1 to: position] cr [self next_ 13] crtab: t1 | t2 [self next_ 13. for t2 to: t1 do [self next_ 9]] default [self of: (String new: 16)] dequeue [self dequeue: 1] dequeue: t1 | t2 [position < t1  [false] t2 _ (array  (1 to: t1)) copy. array  1 to: position - t1 _ array  (t1 + 1 to: position). position _ position - t1. t2] emitLong: t1 by: t2 [[t2 < 0  [t2 _ t2 + 1024] t2 > 1023  [t2 _ 1] t1 _ t1 + 4]. t2 < 0  [user notify: 'A block compiles more than 1K bytes of code'] self next_ t2 / 256 + t1. self next_ t2 \ 256] empty [position = 0] end [position  limit] first [position  0  [array  1] nil] insert: t1 | t2 [[position = limit  [array _ array grow. limit _ array length]]. for t2 to: position do [array  position - t2 + 2 _ array  (position - t2 + 1)]. array  1 _ t1. position _ position + 1] integerScan | t1 t2 t3 t4 t5 [t1 _ [self  21  [1] 1]. t2 _ [self  48  [8] 10]. t3 _ 48 + t2. t5 _ 0. while [t4 _ self next. t4 and (t4  48 and t4 < t3)] do [t5 _ t5 * t2 + (t4 - 48)]. [t4  [self skip: 1]]. t2 = 8 and (t5 > 32767 and (t1 = 1 and t5 < 65536))  [t5 asSmall] (t5 * t1) asInteger] into: t1 | t2 [for t2 to: t1 length do [t1  t2 _ self next]. t1] last [position  0  [array  position] nil] last: t1 [(array  (position - t1 + 1 to: position)) copy] limit [limit] loc [position] myend [position  limit] next [self myend  [self pastend] position _ position + 1. array  position] primitive: 18 next: t1 | t2 [t2 _ array species new: t1. for t1 to: t1 do [t2  t1 _ self next]. t2] next: t1 _ t2 | [for t1 to: t1 do [self next_ t2]] next: t1 from: t2 | [for t1 to: t1 do [self next_ t2 next]] nextNumber: t1 | t2 t3 t4 [t3 _ false. for t2 to: t1 do [t4 _ self next. t3  [t3  t1 + 1 - t2 _ t4] t2 = t1  [t4] t4 = 0  [] t2  (t1 - 2) or (t4 land: 128)  0  [t3 _ Natural new: t1 + 1 - t2. t3 last_ t4] (t4 lshift: 8) + self next]. LargeInteger new bytes: t3 neg: false] nextNumber: t1 _ t2 [t2 is: Integer  [self next: t1 - 2 _ 0. self nextword_ t2] t2 _ t2 bytes. t2 length > t1  [user notify: 'number too big'] self next: t1 - t2 length _ 0. self append: t2 reverse] nextPoint | t1 [t1 _ self nextword. Point new x: t1 y: self nextword] nextPoint_ t1 [self nextword_ t1 x. self nextword_ t1 y] nextString | t1 [t1 _ self next. self into: (String new: [t1 < 192  [t1] t1 - 192 * 256 + self next])] nextString_ t1 | t2 [t2 _ t1 length. [t2 < 192  [self next_ t2] self next_ t2 / 256 + 192. self next_ t2 \ 256]. self append: t1. t1] next_ t1 [self myend  [self pastend_ t1] position _ position + 1. array  position _ t1] primitive: 19 nextword | t1 t2 [t1 _ self next. t1  [t2 _ self next. t2  [(t1 lshift: 8) + t2] false] false] nextword_ t1 [self next_ t1 lshift: 8. self next_ t1 land: 255. t1] of: t1 [array _ t1. position _ 0. limit _ array length] of: t1 from: t2 to: t3 | t4 [array _ t1. t4 _ array length. limit _ [t3 > t4  [t4] t3]. position _ [t2  1  [0] t2 - 1]] padNext [position even  [false] self next] padNext_ t1 [position even  [false] self next_ t1] pastend [false] pastend_ t1 [array _ array grow. limit _ array length. self next_ t1] peek | t1 [t1 _ self next. t1  [position _ position - 1. t1] false] pop [position < 1  [false] position _ position - 1. array  (position + 1)] pop: t1 | t2 [position < t1  [false] t2 _ self last: t1. position _ position - t1. t2] position [position] position_ t1 [position _ t1] print: t1 [t1 printon: self] release [array _ nil] reset [position _ 0] rest [array copy: position + 1 to: limit] semicrtab [self append: '; '] settoend [position _ limit] skip: t1 [position _ position + t1] skipTo: t1 | t2 [for t2 from: self do [t2 = t1  [true]]. false] skipwords: t1 [self skip: 2 * t1] space [self next_ 32] tab [self next_ 9] upto: t1 | t2 t3 [t3 _ (String new: 250) asStream. for t2 from: self do [t2 = t1  [t3 contents] t3 next_ t2]. t3 contents] viewer [SetReader new of: array from: 1 to: position] wordposition [self position / 2] wordposition_ t1 [self position_ t1 * 2] Class new title: String subclassof: Array fields: '' declare: 'StringBlter '; bytesize: false - t1 | t2 t3 t4 [t4 _ self length - t1 length. for t2 to: [t4 < 0  [self length] t1 length] do [t3 _ UpperCase  (self  t2 + 1) - (UpperCase  (t1  t2 + 1)). t3  0  [t3]]. t4] < t1 [(self compare: t1) = 1] > t1 [(self compare: t1) = 3] alignForDisplay [] primitive: 51 all_ t1 [self fill: 1 to: self length with: t1] asBytes | t1 t2 [t1 _ Stream default. for t2 from: self do [t1 append: t2 base8. t1 space]. t1 contents] asDecimalDigits | t1 t2 t3 t4 [t1 _ Stream new of: self. t2 _ t1  21. t4 _ [self length > 4  [0.0] 0]. for t3 from: t1 do [t3 < 48 or: t3 > 57  [user notify: self + ' isn''t a valid integer'] t4 _ t4 * 10 + (t3 - 48)]. t2  [t4 * 1] t4] asFileName [dp0 checkName: self fixing: true] asFloat | t1 t2 t3 t4 [t1 _ Stream new of: self. t2 _ t1 upto: 46. t3 _ t1 upto: 101. t4 _ t1 rest asInteger - t3 length. t2 _ (t2 concat: t3) asDecimalDigits asFloat. t4 = 0  [t2] t4 > 0  [t2 * (10.0 ipow: t4)] t2 / (10.0 ipow: 0 - t4)] asInteger | t1 t2 t3 t4 t5 t6 t7 t8 [self length = 0  [0] t7 _ 1. t8 _ self length. t1 _ [self  1 = 21  [t7 _ 2. 1] 1]. t2 _ [self  self length = 72  [t8 _ t8 - 1. 16] self  t7 = 48  [8] 10]. t3 _ [t2 = 16  [70] 47 + t2]. t5 _ [self length > 4  [0.0] 0]. for t6 from: t7 to: t8 do [t4 _ self  t6. t4 < 48 or: t4 > t3  [user notify: self + ' isn''t a valid Integer'] t5 _ t5 * t2 + [t4  57  [t4 - 48] t4 - 55]]. [t5 > 32767  [t2 = 8 or t2 = 16  [t1 = 1  [t5 < 65536  [(t5 - 65536) asInteger] user notify: 'Warning: Octal or Hex number exceeds 16 bits']]]]. (t5 * t1) asInteger] asLarge | t1 t2 t3 t4 [[self  1 = 21  [t1 _ true] t1 _ false]. t3 _ 0 asLarge. t4 _ 10 asLarge. for t2 from: [t1  [2] 1] to: self length do [t3 _ t3 * t4 + (self  t2 - 48)]. t1  [t3 negated] t3] asParagraph [Paragraph new text: self alignment: 0] asUppercase | t1 t2 [t1 _ Stream default. for t2 from: self do [t1 next_ UpperCase  (t2 + 1)]. t1 contents] asVector [self asStream asVector] base8: t1 [(self word: t1) base8] compare: t1 | t2 t3 t4 t5 t6 t7 [t3 _ t1 length. t7 _ self length. t4 _ [t7 < t3  [t3 _ self length. 1] t7 = t3  [2] 3]. for t2 to: t3 do [t6 _ UpperCase  (t1  t2 + 1). t5 _ UpperCase  (self  t2 + 1). t5 = t6  [] t5 < t6  [1] 3]. t4] copy: t1 to: t2 [(self species new: 1 + t2 - t1) copy: 1 to: 1 + t2 - t1 with: self from: t1 to: t2] copy: t1 to: t2 with: t3 from: t4 to: t5 | t6 [self  t3 and (t4 < t1 and t5  t1)  [for t6 from: t2 - t1 to: 0 by: 1 do [self  t1 + t6 _ self  (t4 + t6)]] t3 copy: t4 to: t5 to: (Stream new of: self from: t1 to: t2)] fill: t1 to: t2 with: t3 | t4 [for t4 from: t1 to: t2 do [self  t4 _ t3]] findString: t1 startingAt: t2 | t3 t4 [t1 length = 0  [0] t4 _ t1  1. for t3 from: t2 to: self length - t1 length + 1 do [self  t3 = t4  [self  (t3 to: t3 + t1 length - 1) = t1  [t3]]]. 0] growto: t1 | t2 [t2 _ self length. [t2  t1  [] t2 _ t1]. (self species new: t1) copy: 1 to: t2 with: self from: 1 to: t2] hasBeenUniqued [a hasInterned: self] hash | t1 t2 [t2 _ self length. t1 _ t2. [t1  2  [t1 = 2  [t2 _ 3] t1 = 1  [(self  1 land: 127) * 106] 21845]]. self  1 * 48 + (self  (t2 - 1) + t1)] inBase: t1 | t2 t3 t4 t5 t6 [[self  1 = 21  [t2 _ true] t2 _ false]. t5 _ 0 asLarge. t6 _ t1 asLarge. for t3 from: [t2  [2] 1] to: self length do [t4 _ self  t3. t5 _ t5 * t6 + [t4  65  [t4 - 65 + 10] t4 - 48]]. t2  [t5 negated] t5] length [self length] lock [] primitive: 53 match: t1 | t2 t3 t4 t5 t6 t7 t8 [t2 _ 42. t3 _ 35. t4 _ self asStream. t1 _ t1 asStream. t5 _ false. while true do [t6 _ t4 next. [t6 = t2  [t4 end  [true] t5 _ t4 position]]. t7 _ t1 next. t7  false  [t7  t6] t6  false  [t5  [t8 _ t5 - t4 position. t4 skip: t8. t1 skip: t8] false] UpperCase  (t7 + 1) = (UpperCase  (t6 + 1)) or t6 = t3  [] t5  [t8 _ t5 - t4 position. t4 skip: t8. t1 skip: t8 + 1] false]] printon: t1 | t2 [t1 next_ 39. for t2 from: self do [t1 next_ t2. t2 = 39  [t1 next_ t2]]. t1 next_ 39] recopy [self copy] replace: t1 to: t2 by: t3 [t3 Is: String  [self replace: t1 to: t2 by: t3 from: 1 to: t3 length] self replace: t1 to: t2 by: t3 asArray from: 1 to: t3 position] replace: t1 to: t2 by: t3 from: t4 to: t5 | t6 t7 [t6 _ self species new: self length + (t5 - t4) - (t2 - t1). t7 _ Stream new of: t6. self copy: 1 to: t1 - 1 to: t7. t3 copy: t4 to: t5 to: t7. self copy: t2 + 1 to: self length to: t7. t6] run: t1 in: t2 [user croak] primitive: 55 species [String] stringhash [self hash] subst: t1 for: t2 | t3 t4 t5 t6 [t5 _ 0. t3 _ t2  1. t6 _ Stream default. for t4 to: self length do [t5 > 0  [t5 _ t5 - 1] self  t4 = t3  [self  (t4 to: (self length min: t4 + t2 length - 1)) = t2  [t6 append: t1. t5 _ t2 length - 1] t6 next_ self  t4] t6 next_ self  t4]. t6 contents] systemRehash | t1 t2 t3 t4 [String understands: 'hash | l m [[(l_ m_ self length)2 [l=2_3]; =1[((self1) land: 0177)*0152] 052525]]. (self1)*060+(self(m-1)+l)]'. a rehash. t1 _ HashSet allInstances + Dictionary allInstances + SymbolTable allInstances. for t2 from: t1 do [t3 _ t2 objects asStream. t4 _ t3 next. while t4 do [t4 is: String  [t2 rehash. t4 _ false] t4 _ t3 next]]] unique | t1 [a intern: self] unlock [] primitive: 53 word: t1 [self  (t1 + t1) + (self  (t1 + t1 - 1) lshift: 8)] word: t1 _ t2 [self  t1 + t1 - 1 _ t2 lshift: 8. self  t1 + t1 _ t2 land: 255. t2] Class new title: StyleSheet subclassof: Object fields: 'fontset linelead lineheight baseline tabsize spacesize effect' declare: '' NoteTakerize | t1 [(fontset  0) NTformat] baseline [baseline] effect [effect] font: t1 [fontset  t1] fontset: t1 [fontset _ t1. self fontset: fontset lineheight: fontset height linelead: 0 baseline: fontset baseline tabsize: 32 spacesize: 4 effect: storing] fontset: t1 lineheight: t2 linelead: t3 baseline: t4 tabsize: t5 spacesize: t6 effect: t7 [fontset _ t1. lineheight _ t2. linelead _ t3. baseline _ t4. tabsize _ t5. spacesize _ t6. effect _ t7] lineheight [lineheight] linelead [linelead] spacesize [spacesize] tabsize [tabsize] Class new title: Substring subclassof: Array fields: 'data map' declare: ''  t1 [data  (map  t1)]  t1 _ t2 [data  map  t1 _ t2] asStream [map isIntervalBy1  [Stream new of: data from: map start to: map stop] Stream new of: self from: 1 to: map length] data: t1 map: t2 [data _ t1. map _ t2] length [map length] map [map] species [data species] swap: t1 with: t2 | t3 [t3 _ map  t1. map  t1 _ map  t2. map  t2 _ t3] Class new title: SymbolTable subclassof: Dictionary fields: '' declare: ''  t1 [(super  t1) value]  t1 _ t2 [super  t1 value_ t2] allCallsOn: t1 from: t2 | t3 t4 t5 t6 t7 [[t1 is: Vector  [] t1 _ t1 inVector]. t4 _ Stream default. user displayoffwhile [for t3 from: t2 do [t6 _ self  t3. for t7 from: t1 do [t5 _ t6 whosends: t7. t5 length = 0  [] t4 append: t3. t4 append: ''. t4 append: t5 asString. t4 cr]]. nil]. t4 contents] allRefs [self allRefsTo: self contents from: user classNames] allRefsTo: t1 from: t2 | t3 [[t1 is: Vector  [] t1 _ t1 inVector]. Smalltalk allCallsOn: (t1 transform [t3] to [self ref: t3]) from: t2] declare: t1 [self declare: t1 from: Undeclared] declare: t1 as: t2 | t3 t4 [t1 is: Vector  [t4 _ t2 asStream. for t3 from: t1 do [self declare: t3 as: t4 next]] self declare: t1. self  t1 _ t2] declare: t1 from: t2 | t3 [t1 is: Vector  [for t3 from: t1 do [self declare: t3 from: t2]] self has: t1  [] t2 has: t1  [super insert: t1 with: (t2 ref: t1). t2 delete: t1] self insert: t1 with: nil] define: t1 as: t2 [self declare: t1 as: t2] growto: t1 | t2 t3 [t3 _ self class new init: t1. for t2 from: self do [t3 insert: t2 withref: (self ref: t2)]. self copyfrom: t3] insert: t1 with: t2 [[self has: t1  [] super insert: t1 with: ObjectReference new]. self  t1 _ t2] insert: t1 withref: t2 [super insert: t1 with: t2] invert: t1 | t2 [for t2 to: values length do [nil  (values  t2)  [] t1  (values  t2) value  [objects  t2]]. false] invertRef: t1 | t2 [for t2 to: values length do [t1  (values  t2)  [objects  t2]]. false] lookup: t1 | t2 [t2 _ super lookup: t1. t2  [t2 value] false] lookupRef: t1 [super lookup: t1] ref: t1 [super  t1] ref: t1 _ t2 [super  t1 _ t2] rehash | t1 t2 [t2 _ SymbolTable new init: self size. for t1 to: objects length do [objects  t1  nil  [] t2 insert: objects  t1 withref: values  t1]. self copyfrom: t2] Class new title: SystemOrganizer subclassof: ClassOrganizer fields: '' declare: '' filoutCategory: t1 | t2 t3 [user displayoffwhile [t2 _ self superclassOrder: t1. (dp0 file: (t1 + '.st.') asFileName) filoutclass: t2. for t3 from: t2 do [(Smalltalk  t3) noChanges]. nil]] printAll | t1 [for t1 from: commentVector do [self printCategory: t1]] printCategory: t1 [user displayoffwhile [(dp0 file: (t1 + '.press') asFileName) printoutclass: (self superclassOrder: t1)]] superclassOrder: t1 | t2 t3 t4 t5 t6 t7 [t3 _ (self category: t1) copy. t2 _ (Vector new: t3 length) asStream. while t3 length > 0 do [t5 _ 1. while [t4 _ t3  t5. t6 _ Smalltalk  t4. t7 _ t6. while [t7 _ t7 superclass. (t7  nil or (t3 has: t7 title unique))  false] do []. t7  nil  false] do [t5 _ t5 + 1]. t2 next_ t4. t3 _ t3 delete: t4]. t2 contents] Class new title: SystemPane subclassof: ListPane fields: 'mySysOrgVersion classPane' declare: 'sysmenu ' classInit [sysmenu _ Menu new string: 'filout print'] classes [selection = 1  [user classNames] selection  2  [Vector new: 0] SystemOrganization category: list  selection] compile: t1 | t2 t3 t4 [selection = 2  [SystemOrganization fromParagraph: t1. self update] t3 _ [selection  1  [false] list  selection]. t2 _ nil  t1. t2 Is: Class  [t4 _ t2 title unique. [t3  [SystemOrganization classify: t4 under: t3]]. mySysOrgVersion  user classNames  [selection > 0  [classPane of: [t3  [SystemOrganization category: t3] user classNames]]] self update]] deselected [classPane of: (Vector new: 0)] dirty [classPane dirty] enter [mySysOrgVersion  user classNames  [super enter] window outline. self update. super enter] forget: t1 | t2 [user notify: 'Class ' + t1 + ' will disappear if you proceed...'. t2 _ Smalltalk  t1. t2 noChanges. t2 obsolete. Smalltalk delete: t1. SystemOrganization delete: t1. AllClassNames _ AllClassNames delete: t1. classPane revise: self classes with: t1] leave [mySysOrgVersion _ user classNames. super leave] noCode [selection = 0  [''] selection = 2  [SystemOrganization] 'Class new title: ''NameOfClass'' subclassof: Object fields: ''names of fields'' declare: ''names of class variables''' copy] selected [classPane of: self classes] to: t1 [classPane _ t1] update [self of: ((AllClasses SystemOrganization ) concat: SystemOrganization categories). mySysOrgVersion _ user classNames] yellowbug | t1 [selection < 3  [window flash] scrollBar hidewhile [t1 _ sysmenu bug. [t1 = 1  [SystemOrganization filoutCategory: list  selection] t1 = 2  [SystemOrganization printCategory: list  selection] nil]]] Class new title: TextImage subclassof: Textframe fields: 'c1 c2 begintypein superimage oldEntity sel' declare: 'bs paste Deletion on paragraphmenu ctlw esc off Scrap scrap cut ' Scrap_ t1 [Scrap _ t1] again | t1 [[self fintype  [Scrap _ Scrap text]]. t1 _ para findString: Deletion startingAt: c2. t1 = 0  [frame flash] self unselect. c1 _ t1. c2 _ c1 + Deletion length. self paste] align [para alignment_ (1 2 4 0 0 )  (1 + para alignment). self displayall. self reversefrom: c1 to: c2] begintypein_ t1 [begintypein _ t1] c1_ t1 [c1 _ t1] c2_ t1 [c2 _ t1] cancel [self flash] checklooks | t1 t2 t3 t4 [t1 _ (166 150 137 151 230 214 201 215 135 159 144 143 128 127 129 131 180 149 199 223 208 207 192 191 240 226 ) find: user kbck. t1 = 0  [false] user kbd. [oldEntity  [] oldEntity _ para. para _ para copy]. t1 = 25  [para _ para toBravo] t1 = 26  [para _ para fromBravo] t2 _ (1 2 4 256 1 2 4 256 0 16 32 48 64 80 96 112 128 144 160 176 192 208 224 240 )  t1. [t2 = 256  [t3 _ 255. t2 _ 0] t2 < 0  [t3 _ 0 - t2. t2 _ 0] t2 > 0 and t2 < 16  [t3 _ t2] t3 _ 240]. para maskrun: c1 to: c2 - 1 under: t3 to: t2. [t3 = 240  [self replace: c1 to: c2 - 1 with: (para copy: c1 to: c2 - 1)] self displaylines: (self lineofchar: c1) to: (self lineofchar: c2)]. self select] classInit [bs _ 8. ctlw _ 145. esc _ 160. cut _ 173. paste _ 158. Deletion _ nullString. Scrap _ Deletion. on _ 1. off _ 0. paragraphmenu _ Menu new string: 'again copy cut paste doit compile undo cancel align fit resize '] close [superimage _ nil] compile [self flash] complement [self complement: on] complement: t1 [t1 = sel  [] t1 = on and (user rawkbck or user redbug)  [] sel _ t1. self reversefrom: c1 to: c2] complementfrom: t1 to: t2 | t3 [t1 minY = t2 minY  [(([t1 minX  t2 minX  [t1 origin rect: t2 corner] t2 origin rect: t1 corner] intersect: frame) intersect: window) comp] [t1 minY > t2 minY  [t3 _ t1. t1 _ t2. t2 _ t3]]. t3 _ frame minX  t1 maxY rect: frame maxX  t2 minY. (((t1 origin rect: t3 maxX  t3 minY) intersect: frame) intersect: window) comp. ((t3 intersect: frame) intersect: window) comp. (((t3 minX  t3 maxY rect: t2 corner) intersect: frame) intersect: window) comp] contents [para] copy | t1 [t1 _ TextImage new paragraph: para copy frame: frame copy style: style copy. t1 c1_ c1. t1 c2_ c2. t1 begintypein_ begintypein. t1] copyselection [Scrap _ self selection] cut [self fintype. self replace: nullString. self select. Scrap _ Deletion] displayat: t1 effect: t2 clippedBy: t3 | t4 [super displayat: t1 effect: t2 clippedBy: t3] doit [self flash] edit: t1 | t2 t3 t4 [superimage _ t1. self show. self reversefrom: c1 to: c2. user waitnobug. until 1 = 2 do [user kbck  [self kbd] user yellowbug  [t4 _ paragraphmenu bug. t4 = 1  [self again] t4 = 2  [self copyselection] t4 = 3  [self cut] t4 = 4  [self paste] t4 = 5  [self doit] t4 = 6  [self compile] t4 = 7  [self undo] t4 = 8  [self cancel] t4 = 9  [self realign] t4 = 10  [self fit] t4 = 11  [self resize]] user redbug  [self reversefrom: c1 to: c2. t2 _ user mp. frame has: t2  [self select: t2] self] user tabletbug  [t2 _ user mp. frame has: t2  [self tabletBug] self reversefrom: c1 to: c2. self] user bluebug  [self reversefrom: c1 to: c2. self]]] enter [begintypein _ false. self show. self select] fintype [begintypein  [[begintypein < c1  [Scrap _ para copy: begintypein to: c1 - 1. c1 _ begintypein]]. begintypein _ false] false] fit | t1 [self white. frame extent_ frame width  1000. t1 _ self rectofchar: para length + 1. frame extent_ frame width  (t1 corner y - frame origin y). self show. frame border: 1 color: 1. self reversefrom: c1 to: c2] fixframe: t1 | t2 [t2 _ [frame  nil  [0] self frameoffset]. window _ t1 copy. window height_ window height | style lineheight - 2. frame _ Rectangle new origin: window origin + (2  t2) extent: window width - 4  9999. self measureall. window] flash [(frame intersect: window) flash] formerly [oldEntity] formerly: t1 [oldEntity _ t1] frame_ t1 [self fixframe: t1] frameoffset [frame minY - window minY] height | t1 [self pointofchar: para length + 1 andrect [t1]. t1 corner y - frame minY] hideData: t1 | t2 t3 t4 [t3 _ para hideData: t1. t2 _ String new: t3 length + 4. t4 _ Stream new. t4 of: t2. t4 append: t3. t2] kbd | t1 t2 [c1 < c2 and self checklooks  [] t1 _ Set new string: 16. [begintypein  [] Deletion _ self selection. begintypein _ c1]. while [t2 _ user kbdnext. t2] do [t2 = bs  [t1 empty  [c1 _ 1 max: c1 - 1. begintypein _ begintypein min: c1] t1 skip: 1] t2 = cut  [self cut] t2 = paste  [self paste] t2 = ctlw  [[t1 empty  [] self replace: t1. t1 reset. c1 _ c2]. c1 _ 1 max: c1 - 1. while (c1 > 1 and (para  (c1 - 1)) tokenish) do [c1 _ c1 - 1]. begintypein _ begintypein min: c1] t2 = esc  [[t1 empty  [self unselect] self replace: t1. c1 _ c2]. self fintype. c1 _ c2 - Scrap length. self complement] t1 next_ t2]. self replace: t1. c1 _ c2. self selectAndScroll] keyset leave [self complement: off] leftflush [self para flushleft] paragraph: t1 frame: t2 style: t3 [para _ t1. frame _ t2. style _ t3. [nil  para  [para _ nullString]]. begintypein _ 1. c2 _ begintypein. c1 _ c2. self para: para frame: frame style: style] paste [self fintype. self unselect. self replace: Scrap. self selectAndScroll] pressCode [4] realign [self align. sel _ on] rectangle [frame] replace: t1 [[oldEntity  [] oldEntity _ para. para _ para copy]. [begintypein  [] Deletion _ self selection]. self replace: c1 to: c2 - 1 with: t1. c2 _ c1 + t1 length] resize | t1 t2 t3 t4 [t1 _ frame origin. CornerCursor topage1. user waitbug. self white. frame corner_ frame origin. until user nobug do [self white. t2 _ superimage superimage mp + superimage superimage rectangle origin. frame corner_ t2 max: frame origin + (16  style lineheight). self displayat: frame origin effect: 0 clippedBy: frame]. NormalCursor topage1. self show. frame boxcomp. self reversefrom: c1 to: c2] reversefrom: t1 to: t2 | t3 t4 t5 [self pointofchar: t1 andrect [t5]. t3 _ t5. [t2 = t1  [t4 _ t3 + (1  0)] self pointofchar: t2 andrect [t5]. t4 _ t5]. self complementfrom: t3 to: t4] scrollPos | t1 [t1 _ self height - self lineheight. t1 = 0  [0.0] 0.0 - self frameoffset / t1] scrollTo: t1 [self scrollUp: self frameoffset + (t1 * self height) - 4] scrollUp: t1 [self scrollby: t1 / self lineheight] scrollby: t1 | t2 [t1 _ t1 * self lineheight max: self frameoffset. frame moveby: 0  (0 - t1). t1 abs  window height  [self show. self select] t2 _ window. window _ [t1 < 0  [window inset: 0  0 and: 0  (0 - t1)] window inset: 0  t1 and: 0  0]. window blt: window origin - (0  t1) mode: storing. [t1 < 0  [window corner y_ window origin y - t1] window origin y_ window corner y - t1]. self displayall. self select. window _ t2] select [self selectIn: nil] select: t1 [self complement: off. c2 _ t1. c1 _ c2. self selectAndScroll] selectAndScroll | t1 t2 t3 [t1 _ self lineheight. self select. t3 _ (self ptofchar: c1) y. t2 _ t3 - window minY. [t2  0  [t2 _ t3 + t1 - 1 - window maxY max: 0]]. t2  0  [self scrollby: t2 abs + t1 - 1 / t1 * t2 sign]] selectIn: t1 [sel _ off. [c1  nil  [c2 _ 1. c1 _ c2]]. self complement: on] selectRange [c1 to: c2 - 1] selectRange: t1 [c1 _ t1 start. c2 _ t1 stop] selecting | t1 t2 t3 t4 t5 t6 t7 t8 [t1 _ user mp. t2 _ self charofpoint: t1 andrect [t3]. self complement: off. self fintype. [t2 = c1 and c1 = c2  [while (user redbug and t2 = (self charofpt: user mp)) do []. user redbug  false  [self selectword. self select. true]]]. sel _ on. c2 _ t2. c1 _ c2. t4 _ t3 + (1  0). self complementfrom: t3 to: t4. t8 _ true. while [t1 _ user mpnext. t1] do [t5 _ self charofpoint: t1 andrect [t6]. [c1 = c2  [t7 _ t5  c2]]. [t7  [[t5 < c1  [t5 _ c1. self pointofchar: t5 andrect [t6]]]. self complementfrom: t6 to: t4. c2 _ t5. t4 _ t6] [t5 > c2  [t5 _ c2. self pointofchar: t5 andrect [t6]]]. self complementfrom: t3 to: t6. c1 _ t5. t3 _ t6]. t3 = t4  [t4 _ t3 + (1  0). self complementfrom: t3 to: t4]]. t7  [] self complementfrom: t4 - (1  0) to: t4] selection [para text empty  [para copy] para copy: c1 to: c2 - 1] selectionAsStream [Stream new of: para text from: c1 to: c2 - 1] selectword | t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 [t3 _ 1. t2 _ t3. t1 _ t2. t8 _ para text. t9 _ t8 length. t5 _ 1. t6 _ '([{<''" '. t7 _ ')]}>''" '. [c1  1  [t3 _ 1. t4 _ c1] c1 > t9  [t4 _ c1 - 1] t1 _ para  (c1 - 1). t4 _ t6 find: t1. t4 > 0  [t3 _ 1. t2 _ t7  t4. t4 _ c1 - 1] t1 _ para  c1. t4 _ t7 find: t1. t4 > 0  [t3 _ 1. t2 _ t6  t4. t4 _ c1] t1 _ 1. t4 _ c1]. until (t5 = 0 or t3 = 1  [t4  t9] t4  1) do [t4 _ t4 + t3. t10 _ t8  t4. t10 = t2  [t5 _ t5 - 1] t10 = t1  [t5 _ t5 + 1] t1 = 1  [(t8  t4) tokenish  [t4 = 1  [t3 _ 1. c1 _ t3. t4 _ c2]] t3 = 1  [c1 _ t4 + 1. t3 _ 1. t4 _ c2 - 1] t5 _ 0]]. [t5  0  [t4 _ t4 + t3]]. t3 = 1  [c2 _ t4 min: t9 + 1] c1 _ t4 + 1] show [[lastline = 0  [super show] self displayall]. sel _ off] showfitted | t1 [super show. t1 _ self rectofchar: para length. t1 bottom > frame bottom  [frame corner y_ t1 corner y. super show]] text [self para text] text: t1 width: t2 | t3 t4 [begintypein _ 1. c2 _ begintypein. c1 _ c2. t3 _ String new: 2. t3 word: 1 _ 16 * 7 + 256. t4 _ Rectangle new origin: 0  0 extent: t2  (DefaultTextStyle lineheight + 2). self paragraph: (Paragraph new text: t1 runs: t3 alignment: 2) frame: t4 style: DefaultTextStyle] typing [self kbd] undo [self fintype. self replace: Deletion. self complement] unselect [self complement: off] white [(frame inset: 2  2) clear: 0] Class new title: TextScanner subclassof: BitBlt fields: 'printing chari stopx xtable exceptions spacecount spacei spacex charpad text spacesize style para font fontno minascii maxascii glyphs frame looktype' declare: 'space defaultExceptions tab cr bs ' callBLT [user croak] primitive: 40 chari [chari] classInit [space _ 32. tab _ 9. cr _ 13. defaultExceptions _ String new: 256. defaultExceptions all_ 0. defaultExceptions  space + 1 _ 12. defaultExceptions  tab + 1 _ 13. defaultExceptions  cr + 1 _ 4] emphasize: t1 leftx: t2 rightx: t3 liney: t4 | t5 t6 [[font  nil or font height = style lineheight  [] [font ascent < style baseline  [t5 _ t4 + (style baseline - font ascent). (t2  t4 rect: t3  t5) clear: white]]. font descent < (style lineheight - style baseline)  [t5 _ t4 + (style baseline + font descent). t6 _ t5 + (style lineheight - (style baseline + font descent)). (t2  t5 rect: t3  t6) clear: white]]. t1 = 0  [] [t1  8  [t1 _ t1 - 8. t5 _ t4 + (style baseline / 2). (t2  t5 rect: t3  (t5 + 1)) clear: black]]. [t1  4  [t1 _ t1 - 4. t5 _ t4 + style baseline. (t2  t5 rect: t3  (t5 + 1)) clear: black]]. [t1  2  [t1 _ t1 - 2. t5 _ t4 + style lineheight - 4. until t5  t4 do [(t2  t4 rect: t3 - 1  t5) blt: t2 + 1  t4 mode: storing. (t2  t4 rect: t2 + 1  t5) clear: white. t5 _ t5 - 4]]]. t1  1  [t1 _ t1 - 1. (t2  t4 rect: t3  (t4 + style lineheight)) blt: t2 + 1  t4 mode: oring]] exceptionTable: t1 [exceptions _ t1] frame: t1 window: t2 para: t3 style: t4 printing: t5 [frame _ t1. para _ t3. style _ t4. printing _ t5. super init. self toDisplay. exceptions _ defaultExceptions. fontno _ 1. para _ para asParagraph. text _ para text. NoteTaker  [self window: t2]] leftx [destx - width] rightx [destx] scanline: t1 at: t2 stopx: t3 stopchar: t4 | t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 [stopx _ t3. chari _ t1 starti - 1. spacecount _ t1 spaces. t11 _ t1 padwidth. t6 _ frame minX. spacex _ t6. destx _ spacex. t14 _ 0. charpad _ t14. t8 _ charpad. t13 _ style tabsize. spacei _ 1. t15 _ para alignment. [t15 = 0  [] t15 = 1  [spacecount > 0  [charpad _ t11 / (t1 stopi - chari + spacecount). [charpad > 0  [t11 _ t11 - (charpad * (t1 stopi - chari - 2 - spacecount)). printing  [(frame minX  t2 rect: frame maxX  (t2 + style lineheight)) clear: white]]]. t14 _ t11 / spacecount. spacecount _ spacecount - (t11 \ spacecount)]] t15 = 2  [destx _ destx + (t11 / 2)] t15 = 4  [destx _ destx + t11]]. t7 _ 10. until t7 < 10 do [t7 = 10  [t7 _ 255. chari  t4  [t7 _ 3] [printing  [self emphasize: t8 leftx: t6 rightx: destx liney: t2]]. t6 _ destx. chari _ chari + 1. t9 _ para runAndVal: chari. t8 _ t9  2 land: 15. t10 _ t9  1 + chari - 1 min: t4. self setfont: (t9  2 lshift: 4) liney: t2] [NoteTaker  [] sourcebase _ glyphs lock]. t7 _ self scanword: t10. [NoteTaker  [] glyphs unlock]. t7 > 10  [[t7 = 12  [spacecount _ spacecount - 1. [spacecount = 0  [t14 _ t14 + 1]]. spacei _ chari. spacex _ destx. width _ spacesize + t14. printing  [function _ 28. self callBLT]] t7 = 13  [t12 _ destx - frame minX. width _ [para alignment > 0  [t13 + charpad] t12 + t13 | t13 - t12]. printing  [function _ 28. self callBLT]] [t7 = 11  [t5 _ maxascii + 1]]. sourcex _ xtable  (t5 + 1). width _ xtable  (t5 + 2) - sourcex. [printing  [function _ 16. self callBLT]]. width _ width + charpad]. destx _ destx + width. destx > stopx  [t7 _ 2] chari  t10  [t7 _ 10] chari _ chari + 1] t7 = 4  [width _ 0]]. printing  [self emphasize: t8 leftx: t6 rightx: destx liney: t2]] scanword: t1 | t2 [function _ 16. until chari > t1 do [t2 _ text  chari. exceptions  (t2 + 1)  0  [exceptions  (t2 + 1)] t2 < minascii or t2 > maxascii  [11] sourcex _ xtable  (t2 + 1). width _ xtable  (t2 + 2) - sourcex. [printing  [self callBLT]]. width _ width + charpad. destx _ destx + width. destx > stopx  [2] chari _ chari + 1]. chari _ chari - 1. 10] primitive: 50 setfont: t1 liney: t2 [t1 = fontno  [desty _ t2 + style baseline - font ascent] fontno _ t1. font _ style font: fontno. xtable _ font xtable. spacesize _ font spacewidth. minascii _ font minascii. maxascii _ font maxascii. glyphs _ font glyphs. printing  [sourceraster _ font raster. desty _ t2 + style baseline - font ascent. height _ font height. NoteTaker  [sourcebase _ glyphs. sourcefield _ height + 1 / 2 * sourceraster]]] spacecount [0 - spacecount] spacei [spacei] spacex [spacex] toDisplay [NoteTaker  [self destForm_ DisplayForm] destbase _ mem  54. destraster _ user screenrect width / 32 * 2] type: t1 [exceptions  (t1 + 1)  0  [exceptions  (t1 + 1)] [t1 < minascii or t1 > maxascii  [t1 _ maxascii + 1]]. stopx _ frame maxX. sourcex _ xtable  (t1 + 1). [t1  space and t1  tab  [width _ xtable  (t1 + 2) - sourcex] t1 = space  [width _ spacesize] width _ style tabsize]. destx + width > stopx or t1 = cr  [1] (destx  desty rect: stopx - width  (desty + height)) blt: destx + width  desty mode: storing. [t1  space and t1  tab  [function _ 16] function _ 28]. [NoteTaker or function = 28  [self callBLT] sourcebase _ glyphs lock. self callBLT. glyphs unlock]. destx _ destx + width. 0] Class new title: Textframe subclassof: Object fields: 'frame window para style lines lastline' declare: 'tab cr space ' Initializations Testing aboutToFrame adjustLines: t1 by: t2 | [lines  t1 stopi_ (lines  t1) stopi + t2. for t1 from: t1 + 1 to: lastline do [lines  t1 slide: t2]] charnearpt: t1 | t2 [self charofpoint: t1 andrect [t2]] charofpoint: t1 | t2 [self charofpoint: t1 andrect [t2]] charofpoint: t1 andrect t2 | t3 t4 t5 t6 t7 t8 t9 t10 [t3 _ 0 max: (self lineofy: t1 y). t6 _ self yofline: t3. [t3 = 0  [t7 _ 1. t9 _ frame minX  (t6 + style lineheight)] t1 y > (t6 + style lineheight)  [self pointofchar: para length + 1 andrect [t10]. t2 value_ t10. para length + 1] t8 _ self printer: false. t8 scanline: lines  t3 at: t6 stopx: t1 x stopchar: (lines  t3) stopi. t7 _ t8 chari. t5 _ t8 rightx. t4 _ t8 leftx. t1 x  (t4 + t5 / 2) or para  t7 = cr  [t9 _ t4  t6] t7 _ t7 + 1. t9 _ t5  t6]. t2 value_ Rectangle new origin: t9 extent: 0  style lineheight. t7] charofpt: t1 | t2 [self charofpoint: t1 andrect [t2]] classInit [space _ 32. cr _ 13. tab _ 9] clear [(frame intersect: window) clear] clearfrom: t1 [((frame origin x  t1 rect: frame corner) intersect: window) clear: white] comp [window comp] displayall | t1 [t1 _ self displaylines: 1 to: lastline. self clearfrom: t1] displayline: t1 at: t2 | t3 t4 t5 t6 [t4 _ self printer: true. t3 _ t2 + style lineheight. [para alignment > 1  [t5 _ frame minX + [para alignment = 4  [t1 padwidth] t1 padwidth / 2]. (window minX  t2 rect: t5  t3) clear: white]]. t4 scanline: t1 at: t2 stopx: window maxX stopchar: t1 stopi. para alignment nomask: 1  [(t4 rightx  t2 rect: window maxX  t3) clear: white]] displaylines: t1 to: t2 | t3 t4 t5 t6 t7 [t1 _ t1 max: (self lineofy: window minY). t2 _ t2 min: (self lineofy: window maxY). t3 _ self yofline: t1. t6 _ t3 + style lineheight. t5 _ self printer: true. for t1 from: t1 to: t2 do [t4 _ lines  t1. [para alignment > 1  [t7 _ frame minX + [para alignment = 4  [t4 padwidth] t4 padwidth / 2]. (window minX  t3 rect: t7  t6) clear: white]]. t5 scanline: t4 at: t3 stopx: window maxX stopchar: t4 stopi. [para alignment nomask: 1  [(t5 rightx  t3 rect: window maxX  t6) clear: white]]. t3 _ t6. t6 _ t6 + style lineheight]. t3] erase [(window inset: 2  2) clear] findmaxx: t1 | t2 t3 t4 [self measureall. t4 _ 0. for t2 to: lastline do [self pointofchar: (lines  t2) stopi andrect [t3]. t3 corner x > t4  [t4 _ t3 corner x]]. t4  t3 corner y] frame [frame] frame: t1 window: t2 para: t3 style: t4 [frame _ t1. window _ t2. para _ t3. style _ t4. [NoteTaker or frame  nil  [] window _ frame intersect: user screenrect. frame _ window]. lines _ Vector new: 32. lastline _ 0. para  nil or frame  nil  [] self measureall] frame_ t1 [frame _ t1. window _ frame] hardcopy | t1 [user displayoffwhile [t1 _ dp0 pressfile: 'frame.press'. self hardcopy: t1. t1 close. t1 toPrinter]] hardcopy: t1 | t2 t3 t4 t5 t6 t7 [for t2 from: ((window inset: 2) minus: window) do [t1 showrect: t2 color: 0]. [para  nil  [self makeParagraph]]. t7 _ para asParagraph. frame = window  [t7 presson: t1 in: (t1 transrect: window)] t5 _ window minY. t4 _ (self charofpt: frame minX + 2  (t5 + 4)) - 1. t6 _ t7 length. while (t4 < t6 and t5 < window maxY) do [t3 _ t4 + 1. t4 _ (self charofpt: frame maxX - 1  (t5 + 4)) min: t6. t2 _ self rectofchar: t4. t5 _ t5 + t2 height. (t7 copy: t3 to: t4) presson: t1 in: (t1 transrect: (frame minX  t2 minY rect: window maxX  (t5 + 10)))]] lastshown | t1 [self charofpoint: window corner andrect [t1]] line: t1 _ t2 [[t1 > lastline  [lastline _ t1]]. [lastline > lines length  [lines _ lines grow]]. lines  t1 _ t2] lineheight [style lineheight] lineofchar: t1 | t2 [for t2 to: lastline do [t1  (lines  t2) stopi  [t2]]. lastline] lineofy: t1 [t1 - frame minY / style lineheight + 1 min: lastline] makeParagraph [para  nil  [para _ 'NIL !' asParagraph]] maxx: t1 | t2 t3 t4 [self measureall. t4 _ 0. for t2 to: lastline do [self pointofchar: (lines  t2) stopi andrect [t3]. t3 corner x > t4  [t4 _ t3 corner x]]. t4  t3 corner y] measureall | t1 t2 t3 [t3 _ 1. t1 _ t3. t2 _ para length. until t1 > t2 do [self line: t3 _ self measurefrom: t1 to: t2. t1 _ (lines  t3) stopi + 1. t3 _ t3 + 1]. self trimLinesTo: t3 - 1] measurefrom: t1 to: t2 | t3 t4 t5 t6 t7 t8 [t3 _ CharLine new starti: t1 stopi: t2 spaces: 0 padwidth: 0. t7 _ self printer: false. t8 _ frame maxX. t7 scanline: t3 at: 0 stopx: t8 stopchar: t2. t4 _ t7 chari. t5 _ t7 spacecount. [t4 = t2 or para  t4 = cr  [t6 _ t8 - t7 rightx. t5 _ 0] t5 > 0  [t4 _ t7 spacei. t6 _ t8 - t7 spacex. [t4 > t1 and para  (t4 - 1) = space  [t5 _ t5 - 1. t6 _ t6 + t7 rightx - t7 leftx] t4 < t2 and para  (t4 + 1) = space  [t4 _ t4 + 1]]. t5 _ 1 max: t5 - 1] t4 _ t4 - 1. t6 _ t8 - t7 leftx]. t3 starti: t1 stopi: t4 spaces: t5 padwidth: t6] outline [window border: 2 color: black] para [para] para: t1 frame: t2 [para _ t1. frame _ t2. self frame: frame window: frame para: para style: DefaultTextStyle] para: t1 frame: t2 style: t3 [para _ t1. frame _ t2. style _ t3. self frame: frame window: frame para: para style: style] pointofchar: t1 | t2 [self pointofchar: t1 andrect [t2]] pointofchar: t1 andrect t2 | t3 t4 t5 t6 [t3 _ self lineofchar: t1. t4 _ self yofline: t3. [t1 > para length  [para length = 0 or para  para length = cr  [t6 _ frame minX  (t4 + style lineheight)] t5 _ self printer: false. t5 scanline: lines  t3 at: t4 stopx: 9999 stopchar: t1 - 1. t6 _ t5 rightx  t4] t5 _ self printer: false. t5 scanline: lines  t3 at: t4 stopx: 9999 stopchar: t1. t6 _ t5 leftx  t4]. t2 value_ Rectangle new origin: t6 extent: 0  style lineheight. t6] printer: t1 [TextScanner new frame: frame window: window para: para style: style printing: t1] ptofchar: t1 | t2 [self pointofchar: t1 andrect [t2]] ptofpt: t1 | t2 [self charofpoint: t1 andrect [t2]. t2 origin] put: t1 at: t2 [para _ t1. self put: para at: t2 centered: false] put: t1 at: t2 centered: t3 | t4 [para _ t1. frame _ t2 rect: 1000  1000. window _ frame. self measureall. self pointofchar: para length + 1 andrect [t4]. window growto: t4 corner. [t3  [window moveby: t2 - window center]]. window _ window inset: 3  2. window clear: white. self show] put: t1 centered: t2 [para _ t1. self put: para at: t2 centered: true] rectofchar: t1 | t2 [self pointofchar: t1 andrect [t2]. t2] replace: t1 to: t2 with: t3 | t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 [para replace: t1 to: t2 by: t3. lastline = 0  [self measureall. self displayall] t13 _ lines copy. t9 _ lastline. t7 _ self lineofchar: t1. t4 _ t7. t8 _ self lineofchar: t2. t11 _ t3 length - (t2 - t1 + 1). t14 _ (lines  t4) starti. [t7 > 1  [t10 _ self measurefrom: (lines  (t7 - 1)) starti to: para length. lines  (t7 - 1) = t10  [] t7 _ t7 - 1. self line: t7 _ t10. t14 _ t10 stopi + 1]]. [t14 > para length  [self trimLinesTo: (t4 - 1 max: 0). para length = 0  [window clear: white. self]]]. t12 _ false. t5 _ t8. until (t12 or t14 > para length) do [t10 _ self measurefrom: t14 to: para length. self line: t4 _ t10. until (t5 > t9 or [t2 _ (t13  t5) stopi + t11. t10 stopi < t2]) do [t2 = t10 stopi  [t15 _ self yofline: t5 + [t11 < 0  [0] 1]. t16 _ self yofline: t4 + [t11 < 0  [0] 1]. t8 _ t4. t12 _ true. t17 _ t9. t5 _ t5 + 1. t6 _ t5 - 1. while [t6 _ 1 + t6. t17  t6] do [t4 _ t4 + 1. self line: t4 _ t13  t6 slide: t11]. self trimLinesTo: t4] t5 _ t5 + 1]. t14 _ t10 stopi + 1. t4 _ t4 + 1]. [t14 > para length  [t8 _ t4 min: lastline. self displaylines: t7 to: t8] (frame minX  t15 rect: window corner) blt: frame minX  t16 mode: storing. self displaylines: t7 to: t8. t16 < t15 and (self yofline: t9 + 1) > window maxY  [t8 _ self lineofy: window maxY. self displaylines: (self lineofy: window maxY - (t15 - t16)) to: t8]]. t8  lastline  [self clearfrom: (self yofline: lastline + 1)]] reversefrom: t1 to: t2 | t3 t4 [[t1 > t2  [t3 _ t1. t1 _ t2. t2 _ t3]]. t3 _ self pointofchar: t1. t4 _ self pointofchar: t2. t1 = t2  [((t3 rect: t3 x + 1  (t3 y + style lineheight)) intersect: window) comp] t3 y = t4 y  [((t3 rect: t4 x  (t4 y + style lineheight)) intersect: window) comp] ((t3 rect: frame corner x  (t3 y + style lineheight)) intersect: window) comp. [t3 y + style lineheight < t4 y  [((frame origin x  (t3 y + style lineheight) rect: frame corner x  t4 y) intersect: window) comp]]. ((frame origin x  t4 y rect: t4 x  (t4 y + style lineheight)) intersect: window) comp] scrolln: t1 [self charofpt: frame corner x  (frame origin y + (t1 * style lineheight))] selectchar: t1 | t2 [self pointofchar: t1 andrect [t2]] show [self measureall. self displayall] show: t1 [para _ t1. self measureall. self displayall] showin: t1 | t2 [t2 _ window. window _ t1. self show. window _ t2] style [style] takeCursor [user cursorloc_ window center] trimLinesTo: t1 | t2 [for t2 from: t1 + 1 to: lastline do [lines  t2 _ nil]. lastline _ t1. lastline < (lines length / 2)  [lines _ lines growby: 0 - (lines length / 2)]] window [window] yofline: t1 [frame minY + (t1 - 1 * style lineheight)] Class new title: TokenCollector subclassof: Object fields: 'sink parenstack' declare: '' comment: t1 [] contents [until parenstack empty do [self rightparen]. sink contents] default [self to: (Vector new: 20)] float: t1 fraction: t2 exp: t3 [self next_ (t1 + '.' + t2 + 'e' + t3) asFloat] identifier: t1 [self next_ t1 unique] integer: t1 [self next_ t1 asInteger] keyword: t1 [self next_ t1 unique] leftparen [parenstack next_ sink. sink _ (Vector new: 10) asStream] next_ t1 [sink next_ t1] notify: t1 [user notify: t1] onechar: t1 | t2 [t2 _ String new: 1. t2  1 _ t1. self next_ t2 unique] otheratom: t1 [self next_ t1 unique] rightparen [parenstack empty  [] parenstack last next_ sink contents. sink _ parenstack pop] separator: t1 [] string: t1 [self next_ t1] to: t1 [sink _ t1 asStream. parenstack _ (Vector new: 5) asStream] trailer: t1 [] Class new title: Turtle subclassof: BitBlt fields: 'frame location direction pen pendown inking' declare: '' color: t1 [color _ t1] drawfrom: t1 to: t2 | t3 t4 t5 t6 t7 t8 t9 t10 [[pen is: Integer  [function _ 12 + (function land: 3). height _ pen. width _ height. t3 _ pen / 2  (pen / 2)] pen is: Form  [function _ function land: 3. super sourceForm_ pen. width _ pen width. height _ pen height. t3 _ pen offset] user notify: 'pen must be a Form or Integer']. destx _ (t1 x - t3 x) asInteger. desty _ (t1 y - t3 y) asInteger. t4 _ (t2 x - t1 x) asInteger  (t2 y - t1 y) asInteger. t5 _ t4 x sign. t6 _ t4 y sign. t7 _ t4 y abs. t8 _ t4 x abs. super callBLT. [t8 > t7  [t9 _ t8 / 2. for t10 to: t8 do [destx _ destx + t5. t9 _ t9 - t7. [t9 < 0  [desty _ desty + t6. t9 _ t9 + t8]]. super callBLT]] t9 _ t7 / 2. for t10 to: t7 do [desty _ desty + t6. t9 _ t9 - t8. [t9 < 0  [destx _ destx + t5. t9 _ t9 + t7]]. super callBLT]]. pen is: Form  [super release: pen]] erase [super window clear: white] go: t1 [self goto: direction asRadians asDirection * t1 + location] goto: t1 | t2 [t2 _ location. location _ t1. pendown  [self drawfrom: t2 to: location]] home [location _ frame center] init [sourceraster _ 0. sourcebase _ sourceraster. super init. super toDisplay. frame _ user screenrect. self pendn. self color: black. self width: 1. self inking: storing. self home. self up] inking: t1 [function _ t1] pen: t1 [pen _ t1] pendn [pendown _ true] penup [pendown _ false] turn: t1 [direction _ direction + t1] up [direction _ 270.0] width: t1 [self pen: t1] Class new title: UniqueString subclassof: String fields: '' declare: ''; bytesize: false  t1 _ t2 [user notify: 'UniqueStrings are not for writing into'] = t1 [self  t1] asString [super copy] classInit | t1 t2 t3 [t3 _ Vector new: 128. t2 _ String new: 1. for t1 to: 128 do [t2  1 _ t1 - 1. t3  t1 _ t2 unique]. UST1 _ t3] copy hasInterned: t1 | t2 t3 [[t1 length = 1  [t1  1 < 128  [UST1  (t1  1 + 1)]]]. t3 _ USTable  (t1 stringhash \ USTable length + 1). for t2 to: t3 length do [t3  t2  nil  [] t1 length = (t3  t2) length  [t1 = (t3  t2)  [t3  t2]]]. false] hash [] primitive: 36 intern: t1 | t2 t3 [t2 _ self hasInterned: t1. t2  [t2] t2 _ [t1 is: UniqueString  [t1] (UniqueString new: t1 length) str: t1]. t3 _ t1 stringhash \ USTable length + 1. USTable  t3 _ USTable  t3 , t2. t2] isarrow [self length  1  [false] self  self length = 95] isinfix | t1 [self length  1  [false] (self  1) isletter  false] iskeyword | t1 [self length  1  [false] t1 _ self  self length. t1 = 58  [true] t1 = 3] isuneval | t1 [self  self length = 3] keywords | t1 t2 t3 t4 t5 t6 t7 ['_' = self  [('' '_' )] t1 _ (Vector new: 10) asStream. t2 _ Stream default. t6 _ ':'  1. t7 _ ''  1. t3 _ 1. t4 _ self length. while t3  t4 do [t5 _ self  t3. t2 append: t5. [(t5 = t6 or t5 = t7) or t3 = t4  [t1 next_ t2 contents. t2 reset]]. t3 _ t3 + 1]. t1 contents] mustTake: t1 [self numArgs  t1  [user notify: self + ' does not take ' + t1 asString + ' arguments']] numArgs | t1 t2 t3 t4 [t1 _ self length. t1 = 1  [[(self  1) isletter  [0] 1]] t2 _ 0. for t3 to: t1 do [t4 _ self  t3. t4 = 58  [t2 _ t2 + 1] t4 = 3  [t2 _ t2 + 1] t4 = 95  [t2 _ t2 + 1] t4 = 7  [t2 _ t2 + 1]]. t2] printon: t1 [t1 append: self] recopy rehash | t1 t2 t3 [t1 _ USTable. USTable _ Vector new: t1 length. for t3 to: t1 length do [USTable  t3 _ Vector new: 0. for t2 from: t1  t3 do [t2  nil  [] self intern: t2]. t1  t3 _ nil]] species [String] str: t1 | t2 [for t2 to: t1 length do [super  t2 _ t1  t2]] stringhash [super hash] unique Class new title: UserView subclassof: Object fields: 'screenrect " current screen size" vtab " offset from hardware top" htab " offset from hardware left" scale " 2 means double bits mode" color " 1 means reverse field" projectWindow "my representative in an overview" disp " default message stream" sched " Windows in this view"' declare: 'screenMenu mxoffset currentCursor myoffset ' InLd: t1 [user notify: 'file problem'] primitive: 53 NTshrink | t1 t2 [self NTshrink1. UserView understands: 'NTshrink1'. Undeclared init. for t1 to: USTable length do [for t2 to: (USTable  t1) length do [(USTable  t1  t2) refct = 1  [USTable  t1  t2 _ nil]]]. a rehash. user  'disp' of: (String new: 256)] NTshrink1 | t1 [Class derstands: (archiveOn:changesOnly: asFollows bytesof: changelist: endCategoryOn: endChangesOn: filout filoutCategory: filoutOrganization paraprinton: printCategory:on: printMethod:on: printout printoutCategory: readfrom: readfrom:format: startCategory:on: startChangesOn: textLocal ). UserView derstands: (backup changedClasses convertTime:returnSecs: file:classes:changesOnly: growSmalltalk: hasXM initCompiler InLd: makeSources: now oopsToFile overlay: printCrossReference: quitFrom: rawtotalsecs reclaim release releaseExternalViews sourcesTo:changesOnly: systemStartup ticks time time timewords today totalsecs ). Paragraph derstands: (bravoRuns fromBravo toBravo applyBravo:at:to: ). Form derstands: (newbrush: blinkbrush: line: arc: resize: edit: classInit ). Number derstands: hex4. for t1 from: Form , Paragraph , TextImage do [t1 derstands: (hidePress:complete: fromPress:value: presson:in: )]. WoodstockFilePool _ nil. AltoFilePool _ WoodstockFilePool. gJuniperConstants _ AltoFilePool. EtherPool _ gJuniperConstants. for t1 from: Smalltalk do [(Smalltalk ref: t1) refct = 1 and Smalltalk  t1  nil  [Smalltalk delete: t1. SystemOrganization delete: t1]]. AllClassNames _ nil] NTshrink2 | t1 t2 [for t1 from: self classNames do [for t2 from: (Smalltalk  t1) md do [user redbug  [nil] t2 refct = 4  [(user request: t1 + ' ' + t2) length = 0  [Smalltalk  t1 derstands: t2]]]]] NTwritem | t1 t2 t3 t5 [self NTpreshrink. Changes init. MethodKeeper _ (Vector new: 10) asStream. [E  nil  [E _ Etherworld new]]. [user sched length = 1 and (user sched  1 is: Dispframe)  [t1 _ CodeWindow new. t2 _ CodePane new class: UserView selector: workspace para: nil. t1 title: 'UserView workspace' with: t2 inVector at: CodeWindow  stdTemplates. t1 frame: (340  22 rect: 580  300). t1 show. t2 showing: (UserView code: workspace). t2 formerly: false. t2 from: t2. user schedule: t1]]. for t3 from: Cursor allInstances do [t3 beNTCursor]. user cr. user show: NTmapper new mapNoteTaker  'nextOop hex'. t5 _ dp0 file: 'MagicNumbers.Saver'. t5 append: (user instfield: 7) contents. t5 close. for t3 from: Cursor allInstances do [t3 beAltoCursor]] Swat [] primitive: 53 anybug [self buttons > 0] anykeys [self keyset > 0] bluebug [self buttons = 1] bugScreenMenu | t1 t2 t3 [t3 _ (Menu new string: 'exit to overview quit open a subview open a browser open a workspace reclaim tablet demo turtle demo') bug. t3 = 1  [projectWindow  nil  [] projectWindow runParent] t3 = 2  [NoteTaker  [user save] user quit] t3 = 3  [self schedule: ProjectWindow init] t3 = 4  [self schedule: BrowseWindow default] t3 = 5  [self schedule: (CodeWindow new class: UserView selector: workspace para: (UserView code: workspace) formerly: false)] t3 = 6  [self reclaim] t3 = 7  [self notify: 'Tablet Demo not yet implemented'] t3 = 8  [t1 _ Turtle init. t1 color: black. t1 width: 4. t1 inking: oring. for t2 to: 50 do [t1 go: t2 * 4. t1 turn: 89]]] buttons | t1 [NoteTaker  [self primMouseKeys land: 7] t1 _ 7 - (mem  488 land: 7). t1 = 0  [t1] (t1 land: 1) * 2 + ((t1 land: 2) / 2) + (t1 land: 4)] calibrate | t1 t2 [user primPort: 330 mask: 0 _ 32. ((50  50) asRectangle inset: 4) comp. ((550  350) asRectangle inset: 4) comp. user waitclickbug. t1 _ (user touchPrim: 1)  (user touchPrim: 0). user waitclickbug. t2 _ (user touchPrim: 1)  (user touchPrim: 0). t1 rect: t2] changedMessages [Changes contents sort] classInit [screenMenu _ Menu new string: 'exit to overview quit open a subview open a browser open a workspace reclaim'] classNames | t1 t2 t3 [AllClassNames  nil  [t1 _ (Vector new: 20) asStream. for t2 from: Smalltalk do [t3 _ Smalltalk  t2. (t3 is: Class) or (t3 is: VariableLengthClass)  [t1 next_ t2]]. AllClassNames _ t1 contents sort] AllClassNames] clear [disp clear] clearshow: t1 [disp clear. disp append: t1. disp show] color: t1 scale: t2 [color _ t1. scale _ t2. self install] convertTime: t1 returnSecs: t2 | t3 t4 t5 t6 t7 t8 t9 [t8 _ mem  376. t9 _ mem  377. t1 _ t1 + ([t8  0  [1] 1] * (3600 * (t8 bits: (1 to: 4)) + (60 * (t9 bits: (1 to: 6))))). t5 _ t1 intdiv: 86400. t3 _ Date new fromDays: t5  1. [t2  [] t5 _ Time new fromSeconds: t5  2]. t6 _ t8 land: 511. [[t6 = 366  [false] t6 _ t6 + t3 leap - 1. t4 _ t3 day. [t4  t6  [t7 _ (t9 land: 511) + t3 leap - 1. t4 < t7 and t4 < ((Date new day: t7 year: t3 year) previous: 6) day] t4  ((Date new day: t6 year: t3 year) previous: 6) day]]  [t2  [t1 _ t1 + 3600] t5 hours = 23  [t3 _ t3 + 1. t5 hours: 0] t5 hours: t5 hours + 1]]. t2  [t1] t3 , t5] copyIn: t1 [UserView new screenrect: screenrect copy vtab: vtab htab: htab scale: scale color: color projectWindow: t1 disp: disp sched: ()] core [user croak] primitive: 57 cr [disp cr] croak [self notify: 'A primitive has failed.'] currentCursor [currentCursor] currentCursor: t1 | t2 t3 t4 [currentCursor _ t1. t2 _ t1 offset. t3 _ self mp. mxoffset _ t2 x - htab. myoffset _ t2 y - vtab. self cursorloc_ t3. NoteTaker  [self mapDisplay] t4 _ BitBlt new. t4 forCursor. t4 sourcebase_ t1 bits. t4 copy: storing] currentDisplay: t1 [DisplayForm _ t1. screenrect _ 0  0 rect: t1 extent. myoffset _ 0. mxoffset _ myoffset. htab _ mxoffset. vtab _ htab. self mapDisplay] cursorBLTer: t1 xoff: t2 yoff: t3 [user croak] primitive: 53 cursorLink: t1 [self croak] primitive: 60 cursorloc_ t1 [NoteTaker  [self primCursorLoc_ t1 - (mxoffset  myoffset)] mem  276 _ t1 x - mxoffset * scale. mem  277 _ t1 y - myoffset * scale] displayHeight: t1 [t1 _ t1 | 16. DisplayForm refct > 3  [user croak] user currentDisplay: (Form new extent: 640  16 bits: (String new: 16 * 80) offset: nil). user currentDisplay: (Form new extent: 640  t1 bits: (String new: t1 * 80) offset: nil). t1] displayoffwhile t1 | t2 t3 [NoteTaker  [t1 eval] t2 _ mem  55. mem  55 _ 58. t3 _ t1 eval. mem  55 _ t2. t3] ev [disp ev] frame [disp text frame] growSmalltalk: t1 [dp0 growSmalltalkBy: t1] install [self screenextent: screenrect extent tab: htab  vtab] kbck | t1 [t1 _ self rawkbck. t1  [kbMap  t1] NoteTaker  [false] self purgealittle. false] kbd [until self rawkbck do [NoteTaker  [] self purgealittle]. kbMap  self rawkbd] kbd: t1 [[t1 is: String  [t1 _ t1  1]]. Events next_ UserEvent new x: self x y: self y type: 1 stroke: (kbMap find: t1) elapsed: Events elapsedtime time: Events time + Events elapsedtime] kbdnext | t1 [NoteTaker  [self kbck  [self kbd] false] while [t1 _ Events dequeue. t1 or [t1 _ Events primitiveDequeue. t1]] do [t1 isKbdDown  [kbMap  t1 stroke]]. false] keyset [NoteTaker  [(self primMouseKeys lshift: 3) land: 31] 31 - ((mem  488 lshift: 3) land: 31)] leaveTop [sched length = 0  [] (sched  1) leave] leftShiftKey [(mem  482 land: 64) = 0] mapDisplay | t1 [DisplayBLTer _ BitBlt init. DisplayBLTer sourceForm_ DisplayForm. DisplayBLTer destForm_ DisplayForm. t1 _ BitBlt init. t1 sourceForm_ currentCursor asForm. t1 destForm_ DisplayForm. t1 source_ 0  0. t1 extent_ currentCursor extent. t1 function_ oring. t1 installForIOP] mp [NoteTaker  [self primMousePt + (mxoffset  myoffset)] scale = 2  [Point new x: mem  276 + mxoffset / 2 y: mem  277 + myoffset / 2] Point new x: mem  276 + mxoffset y: mem  277 + myoffset] mpnext [self redbug  [self mp] false] newdisp [self unschedule: disp. disp _ Dispframe new rect: (8  0 rect: 150  96). self schedule: disp. self clearshow: 'New Dialogue window created. '] newdisploc: t1 and: t2 [(disp text frame inset: 2  2) clear. disp text frame_ t1 rect: t2. disp show] next_ t1 [disp cr. disp print: t1. disp show] noChanges [Changes init] nobug [self anybug  false] notifier: t1 level: t2 interrupt: t3 [self restoredisplay. NotifyFlag  false  [disp cr. disp append: 'NotifyFlag is false...'. disp cr. disp append: ' top-blank shows stack, user restart aborts,'. disp cr. disp append: ' tempframe shows args, ctrl-d proceeds'. disp cr. disp append: t1. disp cr. disp show. (Top  t2) debug. false] NotifyWindow new of: t1 level: t2 interrupt: t3] notifier: t1 stack: t2 interrupt: t3 [self restoredisplay. NotifyFlag  false  [disp cr. disp append: 'NotifyFlag is false...'. disp cr. disp append: ' sender debug shows stack, user restart aborts,'. disp cr. disp append: ' tempframe shows args, ctrl-d proceeds'. disp cr. disp append: t1. disp cr. disp show. t2 debug. false] NotifyWindow new of: t1 stack: t2 interrupt: t3] notify: t1 | t2 [NoteTaker  [self notifyNT: t1. self] t2 _ self notifier: t1 stack: thisContext sender interrupt: false. t2  [thisContext sender_ nil. Top currentPriority = 1  [self restartup: t2] self scheduleOnBottom: t2. Top errorReset] nil] notifyNT: t1 | t2 [NotifyFlag  [t2 _ NotifyWindowNT new. t2 title: t1 processFrame: thisContext current caller caller. NormalCursor topage1. self schedule: t2. self run: true] self clearshow: t1. self cr. self show: 'ctl-d to restart'. self ev. thisContext restart] now [self convertTime: self rawtotalsecs returnSecs: false] overlay: t1 | t2 [self releaseExternalViews. [E  nil  [] E sleep]. t2 _ mem  272. mem  272 _ 0. self InLd: t1. mem  272 _ t2. while user keyset > 0 do [user show: 'The keyset is stuck'. user cr]] primCursorLoc_ t1 [self croak] primitive: 59 primEIANext [self croak] primitive: 64 primEIANext_ t1 [self croak] primitive: 65 primEIAPeek [self croak] primitive: 63 primKbdBlock [self croak] primitive: 69 primKbdNext [self croak] primitive: 62 primKbdPeek [self croak] primitive: 61 primMouseKeys [self croak] primitive: 68 primMousePt [self croak] primitive: 58 primPort: t1 [self croak] primitive: 66 primPort: t1 mask: t2 _ t3 [self croak] primitive: 67 print: t1 [disp print: t1. disp show] projectWindow [[projectWindow  nil  [projectWindow _ ProjectWindow new. projectWindow userview: self changes: Changes parent: projectWindow]]. projectWindow] promote: t1 [sched promote: t1] purgealittle [] primitive: 54 quit [self quitFrom: self] quitThen: t1 | t2 t3 [t2 _ (dp0 file: 'rem.cm') readonly. t3 _ t2 next: t2 length. t2 readwrite. t2 reset. t2 append: t1. t2 cr. t2 append: t3. t2 close. self quit] quitThen: t1 continue: t2 | t3 [[t1  [t3 _ dp0 oldFile: 'rem.cm.'. t3 settoend. t3 append: t1. t3 append: '; '. t3 append: [t2  ['Resume.~ small.boot'] 'Quit.~; Resume.~ small.boot']. t3 cr. t3 flush]]. self quit] rawkbck | t1 t2 t3 [NoteTaker and 'NoEventQ'  [while [t3 _ user primKbdPeek. t3] do [t3  0  [t3] user primKbdNext]. false] while [t1 _ Events peek. t1] do [t1 isKbdDown  [t1 stroke] Events next]. false] rawkbd | t1 [NoteTaker and 'NoEventQ'  [until self rawkbck do []. self primKbdNext] while [t1 _ self rawkbck. t1  false] do []. Events next. t1] rawtotalsecs | t1 [t1 _ self timewords. t1 swap: 1 with: 4. t1 swap: 2 with: 3. LargeInteger new bytes: t1 neg: false] read [disp read] reconfigure [] primitive: 53 redbug [self buttons = 4] releaseExternalViews | t1 [Sources close. dp0 close. dp1 close. for t1 from: externalViews length to: 1 by: 1 do [(externalViews  t1) release. externalViews  t1 _ nil]. externalViews reset] request: t1 [disp request: t1] restart | t1 [[Events  nil  [Events _ EventQueue init]]. NormalCursor topage1. self restart [user run]] restart t1 | t2 [t2 _ t1 cleancopy. t2 sender_ nil. thisContext sender releaseFully. thisContext sender_ nil. t1 _ nil. MessageDict new freeMethods. disp frame flash. while true do [t2 eval]] restartup: t1 [[NoteTaker  [] thisContext sender releaseFully. thisContext sender_ nil]. NormalCursor topage1. self schedule: t1. [NoteTaker  [] thisContext tempframe all_ nil]. self run: true] restore | t1 [[NoteTaker  [Dorado  [] kbMap _ NTkbMap]]. screenrect clear. for t1 from: sched length to: 1 by: 1 do [(sched  t1) show]] restoredisplay [NoteTaker  [] mem  272 _ 48. mem  55 _ screenrect height / 2] run [self run: false] run: t1 | t2 t3 t4 [t4 _ [t1  [t3 _ sched  1. while t3 eachtime do []. t3 lasttime] true]. while true do [t2 _ 0. while [t2 _ t2 + 1. [t2 > sched length  [nil] t3 _ [t4  [sched  t2] sched  (sched length + 1 - t2)]. t3 firsttime]  false] do []. t2 > sched length  [user yellowbug  [self bugScreenMenu]] sched promote: t3. while t3 eachtime do []. t4 _ t3 lasttime]] save [user croak] primitive: 45 sched [sched] schedule: t1 [sched  nil  [sched _ t1 inVector] sched _ t1 inVector concat: sched] scheduleOnBottom: t1 [sched  nil  [sched _ t1 asVector] sched _ sched concat: t1 asVector] screenextent: t1 tab: t2 [mem  53 _ color * 16384 + [scale = 2  [32768] 0] + (t2 x / 16 * 256) + (t1 x / 16 | 2). mem  55 _ t1 y * scale / 2. mem  51 _ 1 max: t2 y / 2. htab _ t2 x | 16. vtab _ mem  51 * 2. screenrect _ 0  0 rect: t1 x | 32  (t1 y | 2). self currentCursor: currentCursor. self reconfigure. self restore] screenrect [screenrect] screenrect: t1 vtab: t2 htab: t3 scale: t4 color: t5 projectWindow: t6 disp: t7 sched: t8 [screenrect _ t1. vtab _ t2. htab _ t3. scale _ t4. color _ t5. projectWindow _ t6. disp _ t7. sched _ t8] show [disp outline. disp show] show: t1 [disp append: t1. disp show] space [disp space] tab [disp tab] tablet [mem  448  0] tabletabsolute [mem  86 _ 1] tabletbug [mem  448 < 0] tabletrelative [mem  86 _ 1] ticks [mem  280] time [self now  2] timewords | t1 [t1 _ Natural new: 4. t1 word: 1 _ mem  378. t1 word: 2 _ mem  379. t1] today [self now  1] topWindow [sched  1] totalsecs [self convertTime: self rawtotalsecs returnSecs: true] touchPrim: t1 | t2 [self primPort: 96 mask: 0 _ t1 + 1 * 256. self primPort: 256 mask: 1 - 448 _ t1. t2 _ self primPort: 448. self primPort: 96 mask: 0 _ 0. t2] touchPt | t1 t2 t3 [false  [user calibrate] t1 _ 880  833 rect: 609  671. t2 _ 50  50 rect: 550  350. t3 _ (self touchPrim: 1) asFloat  (self touchPrim: 0) asFloat. t2 origin + (t3 - t1 origin / t1 extent * t2 extent)] touched [screenrect has: self touchPt] unschedule: t1 | t2 [t2 _ sched find: t1. 0 < t2  [sched _ sched  (1 to: t2 - 1) concat: sched  (t2 + 1 to: sched length)]] version ['Smalltalk 5.5g XM March 6'] versionName | t1 [t1 _ self version asStream. t1 skipTo: 32. t1 upto: 32] waitbug [until self anybug do []. self mp] waitclickbug [self waitnobug. self waitbug] waitnobug [while self anybug do []. self mp] waitnokey [until self keyset = 0 do [self rawkbck]] workspace [user notify: 'Not meant to be executed'] writeChangedMessages: t1 | t2 t3 t4 [t1 settoend. t1 cr. t1 cr. t1 asParagraphPrinter stamp. t2 _ ''. for t3 from: user changedMessages do [t4 _ t3 asStream. (t4 upto: 32) = t2  [t1 append: ', '. t1 append: (t4 upto: 32)] t1 cr. t1 append: t3. t2 _ t3 asStream upto: 32]. t1 close] writeSources: t1 [user file: t1 classes: SystemOrganization changesOnly: t1 end  false. Sources close. Sources _ t1] x [self mp x] y [self mp y] yellowbug [self buttons = 2] Class new title: VariableLengthClass subclassof: Class fields: '' declare: '' allInstances [user notify: 'use allInstances: instead to specify the length range'] allInstances: t1 [(self allInstancesEver: t1) notNil] allInstancesEver: t1 | t2 t3 t4 t5 [NoteTaker  [user notify: 'not implemented'] t4 _ Vmem pclassesOf: self length: t1. t3 _ Vector new: 128 * t4 length. for t5 to: t4 length do [t3  (t5 - 1 * 128 + 1 to: t5 * 128) all_ t4  t5]. thisContext destroyAndReturn: (self fromFreelist: (Vmem freelistOffset: t1) fill: t3)] classInit [(self new: 1) classInit] copy: t1 | t2 t3 [t2 _ self new: t1 length. for t3 to: t1 length do [t2  t3 _ t1  t3]. t2] howMany: t1 | t2 [t2 _ self allInstancesEver: t1. thisContext destroyAndReturn: t2 length - (t2 count: nil)] new [user notify: 'use new: here.'] new: t1 [t1 > 16384  [user notify: t1 asString + ' is too big a String'] t1 > 8192  [user notify: t1 asString + ' is too big a Vector'] t1 < 0  [user notify: t1 asString + ' -- negative length is invalid'] self new: t1 asInteger] primitive: 28 recopy: t1 | t2 t3 [t2 _ self new: t1 length. for t3 to: t1 length do [t2  t3 _ (t1  t3) recopy]. t2] Class new title: VariablePane subclassof: ListPane fields: 'valuePane values context' declare: 'varmenu ' classInit [varmenu _ Menu new string: 'inspect'] compile: t1 [window flash. false] deselected [valuePane showing: ''] execute: t1 for: t2 [valuePane _ t2. valuePane execute: t1 in: context to: values  1] names: t1 values: t2 wrt: t3 [values _ t2. context _ t3. self of: t1] selected [valuePane showing: self value asString] to: t1 [valuePane _ t1] value [selection = 1  [values  1] values  2 inspectfield: selection - 1] yellowbug [selection = 0  [window flash] scrollBar hidewhile [varmenu bug = 1  [self value inspect] nil]] Class new title: Vector subclassof: Array fields: '' declare: '' , t1 | t2 [t2 _ self growby: 1. t2 last_ t1. t2] argsOff: t1 [t1 pop: self length] asVector base: t1 | t2 t3 [t2 _ Stream default. for t3 to: self length do [t2 append: (self  t3 base: t1). t2 space]. t2 contents] emitForValue: t1 on: t2 | t3 [for t3 from: self do [t3 emitForValue: t1 on: t2]] firstPush [(self  1) firstPush] hex | t1 t2 [t1 _ (String new: 4 * self length) asStream. for t2 from: self do [t1 append: t2 hex]. t1 contents] length [self length] max | t1 t2 [t1 _ self  1. for t2 to: self length do [self  t2 > t1  [t1 _ self  t2]]. t1] nail [user croak] primitive: 53 printon: t1 | t2 [t1 append: '('. for t2 to: self length do [t1 print: self  t2. t1 space]. t1 append: ')'] remote: t1 | t2 [for t2 from: self do [t2 remote: t1]] sizeForValue | t1 t2 [t1 _ 0. for t2 from: self do [t1 _ t1 + t2 sizeForValue]. t1] unNail [user croak] primitive: 53 Class new title: Window subclassof: Object fields: 'frame collapsed titlepara growing exitflag ' declare: 'border titleloc titleframe windowmenu titlerun ' aboutToFrame bluebug | t1 [t1 _ windowmenu bug. t1 = 1  [exitflag _ false. exitflag] t1 = 2  [self newframe. self enter] t1 = 3  [self close. self erase. user unschedule: self. false] t1 = 4  [self hardcopy] t1 = 5  [self print]] classInit [border _ 2  2. titleframe _ Textframe new para: nil frame: nil. titleloc _ 3  (4 - titleframe lineheight). titlerun _ String new: 2. titlerun word: 1 _ 255. windowmenu _ Menu new string: 'under frame close print printbits '] clearTitle: t1 [(titleframe window inset: 2  2) clear: t1] close eachtime [[frame has: user mp  [user kbck  [self kbd] [user anybug  [user redbug  [self redbug] user yellowbug  [self yellowbug] user bluebug  [self bluebug]]]. user anykeys  [self keyset]]]. self outside  [] user anybug  [frame has: user mp  [] false] user kbck  [user kbd. frame flash]] editTitle | t1 t2 [t1 _ TextImage new para: titlepara frame: nil. t1 formerly: false. t1 fixframe: titleframe window + (1  2). t1 enter. t2 _ titleframe window. until (user anybug and (t2 has: user mp)  false) do [user kbck  [t1 typing] user redbug  [t2 has: user mp  [t1 selecting]] user yellowbug  [t2 has: user mp  [t2 flash]]]. titlepara _ t1 contents. self showtitle] enter [self show] erase [(frame inset: 2  2) clear. self clearTitle: background] firsttime [frame has: user mp  [self reset. self enter] false] fixedwidthfromuser: t1 | t2 t3 t4 [user waitnobug. [frame  nil  [] self aboutToFrame. self erase]. t2 _ OriginCursor showwhile [user waitbug]. growing _ true. frame _ self fixframe: (t2 rect: t2 + (t1  32)). self frame: frame. self show. CornerCursor showwhile [while [t2 _ user mpnext. t2] do [t2 x_ frame corner x. [t4  nil  [user cursorloc_ t2 max: frame corner]]. t4 _ frame copy. frame _ self fixframe: (frame growto: t2). self frame: frame. self moveFrom: t4]. nil]. growing _ false. self takeCursor] fixframe: t1 [t1] frame [frame] frame: t1 [frame _ self fixframe: t1] hardcopy [frame flash] kbd [user kbd. frame flash] keyset [frame flash] lasttime [self leave. exitflag] leave moveFrom: t1 [(t1 inset: 2) clear. self show] newframe | t1 t2 [user waitnobug. [frame  nil  [] self aboutToFrame. self erase]. t1 _ OriginCursor showwhile [user waitbug]. growing _ true. frame _ self fixframe: (t1 rect: t1 + 32). frame outline. CornerCursor showwhile [while [t1 _ user mpnext. t1] do [[t2  nil  [user cursorloc_ t1 max: frame corner]]. t2 _ frame copy. frame _ self fixframe: (frame growto: t1). (t2 inset: 2) clear. frame outline]. nil]. self frame: frame. growing _ false. self takeCursor] outline [frame outline] outside [titleframe window has: user mp  [user anybug  [self editTitle] false] false] print | t1 [t1 _ dp0 pressfile: (self title + '.press.') asFileName. t1 screenout: frame scale: PressScale. t1 toPrinter] redbug [frame flash] reset [exitflag _ true. growing _ false] show [self outline. growing  [] self showtitle] showtitle [[titlepara  nil  [titlepara _ Paragraph new text: self title runs: titlerun alignment: 0]]. titleframe put: titlepara at: frame origin + titleloc. titleframe outline] takeCursor [user cursorloc_ frame center] title ['Untitled'] yellowbug [frame flash]