The Trunk: Tools-dtl.846.mcz

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

The Trunk: Tools-dtl.846.mcz

commits-2
David T. Lewis uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-dtl.846.mcz

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

Name: Tools-dtl.846
Author: dtl
Time: 6 April 2019, 7:02:48.955673 pm
UUID: 32d1a183-ed6d-48f4-bdb8-2441a3811295
Ancestors: Tools-kks.845

MethodFinder raises a deprecation warning when evaluating this:

  'abcdef' . $e . 'abcd'

Suppress the warning by proceding though the Deprecation. The deprecated SequenceableCollection>>#upTo: will still be included in the search results.

=============== Diff against Tools-kks.845 ===============

Item was changed:
  ----- Method: MethodFinder>>testPerfect: (in category 'search') -----
  testPerfect: aSelector
  "Try this selector!! Return true if it answers every example perfectly.  Take the args in the order they are.  Do not permute them.  Survive errors.  later cache arg lists."
 
  | sz argList val rec activeSel perform |
  "Transcript cr; show: aSelector. debug"
  perform := aSelector beginsWith: 'perform:'.
  sz := argMap size.
  1 to: thisData size do: [:ii | "each example set of args"
  argList := (thisData at: ii) copyFrom: 2 to: sz.
  perform
  ifFalse: [activeSel := aSelector]
  ifTrue: [activeSel := argList first. "what will be performed"
  ((Approved includes: activeSel) or: [AddAndRemove includes: activeSel])
  ifFalse: [^ false]. "not approved"
  aSelector == #perform:withArguments:
  ifTrue: [activeSel numArgs = (argList at: 2) basicSize "avoid error"
  ifFalse: [^ false]]
  ifFalse: [activeSel numArgs = (aSelector numArgs - 1)
  ifFalse: [^ false]]].
  1 to: sz do: [:num |
  (Blocks includes: (Array with: activeSel with: num)) ifTrue: [
  (argList at: num) isBlock ifFalse: [^ false]]].
  rec := (AddAndRemove includes: activeSel)
  ifTrue: [(thisData at: ii) first isSymbol ifTrue: [^ false].
  "vulnerable to modification"
  (thisData at: ii) first copyTwoLevel] "protect from damage"
  ifFalse: [(thisData at: ii) first].
+ val := [[rec perform: aSelector withArguments: argList]
+ on: Deprecation do: [ :ex | ex resume ]]
+ ifError: [:aString :aReceiver |
- val := [rec perform: aSelector withArguments: argList]
- ifError: [:aString :aReceiver |
  "self test3."
  "self test2: (thisData at: ii)."
  ^ false].
  "self test3."
  "self test2: (thisData at: ii)."
  ((answers at: ii) closeTo: val) ifFalse: [^ false].
  ].
  ^ true!