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]]