MethodFinder.st
author Claus Gittinger <cg@exept.de>
Sat, 28 Sep 2019 16:32:40 +0200
changeset 4504 196828a4584c
parent 4503 524210dd5d9e
child 4505 525d1fd161ed
permissions -rw-r--r--
#REFACTORING by exept class: MethodFinder comment/format in: #constMod #insertConstants #load: #makeAllMaps #mapData #permuteArgs #warnTooManyArguments changed: #allNumbers #cleanInputs: #constLessThan #findMessage class: MethodFinder class comment/format in: #documentation changed: #methodFor:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4497
6cf4d7eac602 #TUNING by exept
Claus Gittinger <cg@exept.de>
parents: 4493
diff changeset
     1
"{ Encoding: utf8 }"
6cf4d7eac602 #TUNING by exept
Claus Gittinger <cg@exept.de>
parents: 4493
diff changeset
     2
1983
9d849f1f9a94 copyright
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
     3
"
4026
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
     4
 Copyright (C) Original Authors (Kaehler, Scott Wallace and Dan Ingalls)
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
     5
 Copyright (C) 2001 eXept Software AG
1983
9d849f1f9a94 copyright
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
     6
4026
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
     7
 Permission is hereby granted, free of charge, to any 
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
     8
 person obtaining a copy of this software and associated 
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
     9
 documentation files (the 'Software'), to deal in the 
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    10
 Software without restriction, including without limitation 
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    11
 the rights to use, copy, modify, merge, publish, distribute, 
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    12
 sublicense, and/or sell copies of the Software, and to 
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    13
 permit persons to whom the Software is furnished to do so, 
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    14
 subject to the following conditions:
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    15
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    16
 The above copyright notice and this permission notice shall 
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    17
 be included in all copies or substantial portions of the Software.
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    18
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    19
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    20
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    21
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    22
 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    23
 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    24
 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    25
 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1983
9d849f1f9a94 copyright
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
    26
"
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
    27
"{ Package: 'stx:libbasic3' }"
40d9ddd1f510 initial checkin
james
parents:
diff changeset
    28
3773
6e1038b06ec1 class: MethodFinder
Claus Gittinger <cg@exept.de>
parents: 3690
diff changeset
    29
"{ NameSpace: Smalltalk }"
6e1038b06ec1 class: MethodFinder
Claus Gittinger <cg@exept.de>
parents: 3690
diff changeset
    30
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
    31
Object subclass:#MethodFinder
1106
50a16e11b73a more st/x messages
Claus Gittinger <cg@exept.de>
parents: 1104
diff changeset
    32
	instanceVariableNames:'data answers selector argMap thisData mapStage mapList
50a16e11b73a more st/x messages
Claus Gittinger <cg@exept.de>
parents: 1104
diff changeset
    33
		expressions cachedClass cachedArgNum cachedSelectorLists'
1491
8941fc515d83 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1114
diff changeset
    34
	classVariableNames:'AddAndRemove Approved Blocks BlocksOptional Dangerous'
1106
50a16e11b73a more st/x messages
Claus Gittinger <cg@exept.de>
parents: 1104
diff changeset
    35
	poolDictionaries:''
3872
2b1a0e287ed8 class: MethodFinder
Claus Gittinger <cg@exept.de>
parents: 3773
diff changeset
    36
	category:'Interface-Tools'
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
    37
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
    38
1100
0502179eabd1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
    39
!MethodFinder class methodsFor:'documentation'!
0502179eabd1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
    40
1983
9d849f1f9a94 copyright
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
    41
copyright
9d849f1f9a94 copyright
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
    42
"
4026
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    43
 Copyright (C) Original Authors (Kaehler, Scott Wallace and Dan Ingalls)
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    44
 Copyright (C) 2001 eXept Software AG
1983
9d849f1f9a94 copyright
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
    45
4026
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    46
 Permission is hereby granted, free of charge, to any 
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    47
 person obtaining a copy of this software and associated 
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    48
 documentation files (the 'Software'), to deal in the 
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    49
 Software without restriction, including without limitation 
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    50
 the rights to use, copy, modify, merge, publish, distribute, 
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    51
 sublicense, and/or sell copies of the Software, and to 
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    52
 permit persons to whom the Software is furnished to do so, 
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    53
 subject to the following conditions:
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    54
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    55
 The above copyright notice and this permission notice shall 
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    56
 be included in all copies or substantial portions of the Software.
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    57
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    58
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    59
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    60
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    61
 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    62
 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    63
 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    64
 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1983
9d849f1f9a94 copyright
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
    65
"
9d849f1f9a94 copyright
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
    66
!
9d849f1f9a94 copyright
Claus Gittinger <cg@exept.de>
parents: 1961
diff changeset
    67
1100
0502179eabd1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
    68
documentation
0502179eabd1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
    69
"
4026
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    70
  a utility to find implementing methods by example.
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    71
  Give it values for a receiver, optional arguments and a desired result,
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    72
  and it will find methods which do that for you.
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    73
  Please read the online documentation for details,
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    74
  or open the MethodFinderView GUI.
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    75
  
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    76
  [example:]
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    77
    which message, answers 7, given to 4 with an argument of 3,
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    78
    and also answers 5, if sent with an arg of 5 to 0
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    79
    and 10, if send to 5 with an argument of 5:    
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    80
    
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    81
      MethodFinder methodFor: #(
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    82
                                (4 3) 7
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    83
                                (0 5) 5
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    84
                                (5 5) 10
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    85
                              )
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    86
    You guessed it; it's the '+' message. 
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    87
                              
4504
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
    88
  [example:]
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
    89
      MethodFinder methodFor: #(
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
    90
                                (4) 8
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
    91
                                (0) 0
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
    92
                                (5) 10
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
    93
                              )
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
    94
1100
0502179eabd1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
    95
  [author:]
4026
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    96
    original squeak version by Ted Kaehler, Scott Wallace and Dan Ingalls.
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    97
    ported from Squeak and GUI enhanced 2001 by James Hayes james@exept.de.
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
    98
    improved by Claus Gittinger.
1100
0502179eabd1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
    99
"
0502179eabd1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   100
! !
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   101
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   102
!MethodFinder class methodsFor:'accessing'!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   103
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   104
abortAllSignal
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   105
    "return the value of the static variable 'AbortAllSignal' (automatically generated)"
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   106
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   107
    ^ AbortAllSignal
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   108
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   109
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   110
abortAllSignal:something
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   111
    "set the value of the static variable 'AbortAllSignal' (automatically generated)"
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   112
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   113
    AbortAllSignal := something.
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   114
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   115
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   116
addAndRemove
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   117
    "return the value of the static variable 'AddAndRemove' (automatically generated)"
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   118
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   119
    ^ AddAndRemove
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   120
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   121
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   122
addAndRemove:something
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   123
    "set the value of the static variable 'AddAndRemove' (automatically generated)"
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   124
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   125
    AddAndRemove := something.
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   126
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   127
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   128
approved
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   129
    "return the value of the static variable 'Approved' (automatically generated)"
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   130
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   131
    ^ Approved
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   132
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   133
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   134
approved:something
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   135
    "set the value of the static variable 'Approved' (automatically generated)"
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   136
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   137
    Approved := something.
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   138
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   139
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   140
blocks
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   141
    "return the value of the static variable 'Blocks' (automatically generated)"
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   142
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   143
    ^ Blocks
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   144
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   145
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   146
blocks:something
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   147
    "set the value of the static variable 'Blocks' (automatically generated)"
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   148
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   149
    Blocks := something.
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   150
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   151
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   152
dangerous
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   153
    "return the value of the static variable 'Dangerous' (automatically generated)"
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   154
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   155
    ^ Dangerous
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   156
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   157
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   158
dangerous:something
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   159
    "set the value of the static variable 'Dangerous' (automatically generated)"
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   160
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   161
    Dangerous := something.
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   162
! !
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   163
4026
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
   164
!MethodFinder class methodsFor:'utilities'!
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
   165
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
   166
methodFor: dataAndAnswers
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
   167
    "Return a Smalltalk expression that computes these answers."
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
   168
4504
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   169
    | finder resultOC resultString |
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   170
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   171
    finder := self new.
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   172
    finder load: dataAndAnswers.
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   173
    resultOC := finder findMessage.
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   174
    resultOC isString ifTrue:[
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   175
        ^ resultString
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   176
    ].
4026
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
   177
    resultString := 
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
   178
        String streamContents: [:strm |
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
   179
            resultOC do: [:exp | strm nextPut: $(; nextPutAll: exp; nextPut: $); space]
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
   180
        ].
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
   181
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
   182
    ^ resultString
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
   183
! !
2d9b8d100559 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4025
diff changeset
   184
2772
8e0cfc719236 category of:
Claus Gittinger <cg@exept.de>
parents: 2285
diff changeset
   185
!MethodFinder methodsFor:'accessing'!
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   186
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   187
answers
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   188
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   189
        ^ answers
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   190
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   191
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   192
data
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   193
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   194
        ^ data
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   195
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   196
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   197
expressions
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   198
        ^ expressions
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   199
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   200
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   201
selectors
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   202
        "Note the inst var does not have an S on the end"
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   203
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   204
        ^ selector
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   205
! !
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   206
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   207
!MethodFinder methodsFor:'arg maps'!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   208
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   209
argMap
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   210
        ^ argMap 
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   211
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   212
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   213
makeAllMaps 
4504
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   214
    "Make a giant list of all permutations of the args.  
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   215
     To find the function, we will try these permutations of the input data.  
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   216
     receiver, args."
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   217
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   218
    | ii |
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   219
4504
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   220
    mapList := Array new: argMap size factorial.
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   221
    ii := 1.
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   222
    argMap permutationsDo: [:perm |
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   223
        mapList at: ii put: perm copy.
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   224
        ii := ii + 1
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   225
    ].
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   226
    mapStage := 1.   "about to be bumped"
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   227
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   228
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   229
mapData 
4504
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   230
    "Force the data through the map (permutation) to create the data to test."
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   231
4504
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   232
    thisData := 
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   233
        data collect: [:realData |
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   234
            argMap collect: [:ind | realData at: ind]
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   235
        ].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   236
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   237
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   238
permuteArgs 
4504
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   239
    "Run through ALL the permutations.  
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   240
     First one was as presented."
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   241
4504
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   242
    data first size <= 1 ifTrue: [^ false]. "no other way"
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   243
    "/ on first call, create the mapList
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   244
    mapList isNil ifTrue: [self makeAllMaps].
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   245
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   246
    mapStage := mapStage + 1.
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   247
    mapStage > mapList size ifTrue: [^ false].
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   248
    argMap := mapList at: mapStage.
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   249
    self mapData.
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   250
    ^ true
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   251
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   252
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   253
thisData
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   254
        ^ thisData 
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   255
! !
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   256
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   257
!MethodFinder methodsFor:'find a constant'!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   258
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   259
allNumbers
4504
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   260
    "Return true if all answers and all data are numbers."
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   261
4504
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   262
    (answers conform:#isNumber) ifFalse: [^ false].
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   263
    thisData do: [:vec |
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   264
         (vec conform:#isNumber) ifFalse: [^ false].
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   265
    ].
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   266
    ^ true
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   267
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   268
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   269
const
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   270
        | const |
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   271
        "See if (^ constant) is the answer"
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   272
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   273
        "quick test"
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   274
        ((const _ answers at: 1) closeTo: (answers at: 2)) ifFalse: [^ false].
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   275
        3 to: answers size do: [:ii | (const closeTo: (answers at: ii)) ifFalse: [^ false]].
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   276
        expressions add: '^ ', const printString.
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   277
        selector add: #yourself.
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   278
        ^ true
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   279
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   280
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   281
constDiv
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   282
        "See if (data1 // C) is the answer"
2054
000555279ed8 changed #constDiv
Claus Gittinger <cg@exept.de>
parents: 2026
diff changeset
   283
        self breakPoint:#cg.
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   284
        ^ false.
2026
dd6a51f84ac2 changed #constDiv
Claus Gittinger <cg@exept.de>
parents: 1983
diff changeset
   285
3320
064c17a6d1bb class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3316
diff changeset
   286
"/        const _ ((thisData at: 1) at: 1) // (answers at: 1).  "May not be right!!"
064c17a6d1bb class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3316
diff changeset
   287
"/        got _ (subTest _ MethodFinder new copy: self addArg: const) 
064c17a6d1bb class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3316
diff changeset
   288
"/                                searchForOne isEmpty not.
064c17a6d1bb class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3316
diff changeset
   289
"/        got ifFalse: [^ false]. 
064c17a6d1bb class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3316
diff changeset
   290
"/
064c17a6d1bb class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3316
diff changeset
   291
"/        "replace data2 with const in expressions"
064c17a6d1bb class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3316
diff changeset
   292
"/        subTest expressions do: [:exp |
064c17a6d1bb class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3316
diff changeset
   293
"/                expressions add: (exp copyReplaceString: "copyReplaceAll:" 'data2' withString: "with:" const printString)].
064c17a6d1bb class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3316
diff changeset
   294
"/        selector addAll: subTest selectors.
064c17a6d1bb class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3316
diff changeset
   295
"/        ^ true
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   296
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   297
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   298
constLessThan
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   299
        | const subTest got minConst maxConst tt |
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   300
        "See if (data1 <= C) or (data1 >= C) is the answer"
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   301
4504
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   302
        (answers conform:#isBoolean) ifFalse: [^ false].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   303
4504
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   304
        minConst := Float infinity.  
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   305
        maxConst := minConst negated.
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   306
        answers withIndexDo: [:aa :ii |
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   307
                aa ifTrue: [tt _ (thisData at: ii) at: 1.
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   308
                        minConst _ minConst min: tt.
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   309
                        maxConst _ maxConst max: tt]].
4504
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   310
        const := (thisData at: 1) at: 1.
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   311
        got := (subTest := MethodFinder new copy: self addArg: minConst) 
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   312
                                searchForOne isEmpty not.
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   313
        got ifFalse: ["try other extreme for <= >= "
4504
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   314
                got := (subTest := MethodFinder new copy: self addArg: maxConst) 
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   315
                                searchForOne isEmpty not]. 
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   316
        got ifFalse: [^ false]. 
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   317
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   318
        "replace data2 with const in expressions"
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   319
        subTest expressions do: [:exp |
2904
021381917b28 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 2895
diff changeset
   320
                expressions add: (exp copyReplaceString: "copyReplaceAll:" 'data2' withString: "with:" const printString)].
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   321
        selector addAll: subTest selectors.
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   322
        ^ true
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   323
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   324
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   325
constLinear
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   326
        | const subTest got denom num slope offset |
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   327
        "See if (data1 * C1) + C2 is the answer.  In the form  #(C2 C1) polynomialEval: data1 "
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   328
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   329
        denom _ ((thisData at: 2) at: 1) - ((thisData at: 1) at: 1).
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   330
        denom = 0 ifTrue: [^ false].   "will divide by it"
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   331
        num _ (answers at: 2) - (answers at: 1).
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   332
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   333
    slope := (num asFloat / denom) reduce.
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   334
    offset := ((answers at: 2) - (((thisData at: 2) at: 1) * slope)) reduce.
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   335
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   336
        const _ Array with: offset with: slope.
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   337
        got _ (subTest _ MethodFinder new copy: self addArg: const) 
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   338
                                searchForOne isEmpty not.
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   339
        got ifFalse: [^ false]. 
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   340
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   341
        "replace data2 with const in expressions"
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   342
        subTest expressions do: [:exp |
2904
021381917b28 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 2895
diff changeset
   343
                expressions add: (exp copyReplaceString: "copyReplaceAll:" 'data2' withString: "with:" const printString)].
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   344
        selector addAll: subTest selectors.
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   345
        ^ true
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   346
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   347
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   348
constMod
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   349
        | subTest low |
4504
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   350
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   351
        "See if mod, (data1 \\ C) is the answer"
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   352
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   353
        low _ answers max.
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   354
        low+1 to: low+20 do: [:const |
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   355
                subTest _ MethodFinder new copy: self addArg: const.
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   356
                (subTest testPerfect: #\\) ifTrue: [
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   357
                        expressions add: 'data1 \\ ', const printString.
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   358
                        selector add: #\\.
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   359
                        ^ true]].
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   360
        ^ false
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   361
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   362
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   363
constMult
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   364
        | const subTest got |
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   365
        "See if (data1 * C) is the answer"
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   366
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   367
        ((thisData at: 1) at: 1) = 0 ifTrue: [^ false].
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   368
        const _ ((answers at: 1) asFloat / ((thisData at: 1) at: 1)) reduce.
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   369
        got _ (subTest _ MethodFinder new copy: self addArg: const) 
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   370
                                searchForOne isEmpty not.
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   371
        got ifFalse: [^ false]. 
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   372
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   373
        "replace data2 with const in expressions"
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   374
        subTest expressions do: [:exp |
2904
021381917b28 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 2895
diff changeset
   375
                expressions add: (exp copyReplaceString: "copyReplaceAll:" 'data2' withString: "with:" const printString)].
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   376
        selector addAll: subTest selectors.
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   377
        ^ true
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   378
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   379
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   380
constPlus
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   381
        | const subTest got |
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   382
        "See if (data1 + C) is the answer"
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   383
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   384
        const _ (answers at: 1) - ((thisData at: 1) at: 1).
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   385
        got _ (subTest _ MethodFinder new copy: self addArg: const) 
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   386
                                searchForOne isEmpty not.
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   387
        got ifFalse: [^ false]. 
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   388
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   389
        "replace data2 with const in expressions"
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   390
        subTest expressions do: [:exp |
2904
021381917b28 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 2895
diff changeset
   391
                expressions add: (exp copyReplaceString: "copyReplaceAll:" 'data2' withString: "with:" const printString)].
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   392
        selector addAll: subTest selectors.
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
   393
        ^ true
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   394
! !
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   395
2248
bfaa21d84997 category of:8 methods
Claus Gittinger <cg@exept.de>
parents: 2229
diff changeset
   396
!MethodFinder methodsFor:'initialization'!
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   397
3515
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   398
cleanInputs:dataAndAnswerString 
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   399
    "Find and remove common mistakes.  Complain when ill formed."
4504
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   400
3515
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   401
    |fixed ddd rs places|
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   402
3515
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   403
    ddd := dataAndAnswerString.
4504
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   404
4025
3e0c6dd0ad9e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3951
diff changeset
   405
    "/ check if user typed #true / #false instead of true / false
4504
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   406
3515
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   407
    fixed := false.
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   408
    rs := ReadStream on:ddd , ' '.
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   409
    places := OrderedCollection new.
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   410
    [
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   411
        rs upToAll_positionBefore:'#true'.
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   412
        rs atEnd
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   413
    ] whileFalse:[ places addFirst:rs position ].
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   414
    places do:[:pos | 
4504
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   415
        ddd := ddd copyReplaceFrom:pos to:pos with:''.
3515
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   416
        fixed := true
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   417
    ].
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   418
    rs := ReadStream on:ddd.
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   419
    places := OrderedCollection new.
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   420
    [
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   421
        rs upToAll_positionBefore:'#false'.
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   422
        rs atEnd
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   423
    ] whileFalse:[ places addFirst:rs position ].
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   424
    places do:[:pos | 
4504
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   425
        ddd := ddd copyReplaceFrom:pos to:pos with:''.
3515
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   426
        fixed := true
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   427
    ].
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   428
    fixed ifTrue:[
4504
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   429
        self information:'#true and #false are Symbols, not Booleans.  
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   430
Next time use true / false.'
3515
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   431
    ].
4504
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   432
4025
3e0c6dd0ad9e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3951
diff changeset
   433
    "/ check if user typed #nil instead of nil
3e0c6dd0ad9e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3951
diff changeset
   434
3515
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   435
    fixed := false.
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   436
    rs := ReadStream on:ddd.
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   437
    places := OrderedCollection new.
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   438
    [
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   439
        rs upToAll_positionBefore:'#nil'.
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   440
        rs atEnd
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   441
    ] whileFalse:[ places addFirst:rs position ].
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   442
    places do:[:pos | 
4504
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   443
        ddd := ddd copyReplaceFrom:pos to:pos with:''.
3515
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   444
        fixed := true
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   445
    ].
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   446
    fixed ifTrue:[
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   447
        self 
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   448
            information:'#nil is a Symbol, not the authentic UndefinedObject.  
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   449
Next time use nil instead of #nil'
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   450
    ].
203e27373562 class: MethodFinder
Stefan Vogel <sv@exept.de>
parents: 3513
diff changeset
   451
    ^ ddd
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   452
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   453
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   454
initialize
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   455
    "The methods we are allowed to use.  (MethodFinder new initialize) "
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   456
        Approved := Set new.
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   457
        AddAndRemove := Set new.
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   458
        Blocks := Set new.
1491
8941fc515d83 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1114
diff changeset
   459
        BlocksOptional := Set new.
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   460
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   461
       "These modify an argument: 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   462
            longPrintOn: printOn: storeOn: sentTo: storeOn:base: printOn:base: 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   463
            absPrintExactlyOn:base: absPrintOn:base: absPrintOn:base:digitCount: 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   464
            writeOn: writeScanOn: possibleVariablesFor:continuedFrom:"
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   465
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   466
"Object"  
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   467
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   468
    "in class, instance creation" 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   469
        "categoryForUniclasses" "chooseUniqueClassName" "initialInstance" "isSystemDefined"
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   470
        newFrom: "officialClass" "readCarefullyFrom:"
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   471
    "accessing" 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   472
        at: basicAt: basicSize "bindWithTemp:" in: size yourself 
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   473
    "testing" 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   474
        "basicType" ifNil: #'ifNil:ifNotNil:' ifNotNil: #'ifNotNil:ifNil:' 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   475
        isColor isArray isFloat isFraction "isInMemory" isInteger isMorph isNil isNumber 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   476
        isPoint "isPseudoContext" isText isTransparent "isWebBrowser" isCollection
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   477
        "knownName" notNil "pointsTo:" "wantsSteps" 
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   478
    "comparing" 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   479
        = == closeTo: hash "hashMappedBy:" identityHash "identityHashMappedBy:" "identityHashPrintString" 
1109
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
   480
        ~= ~~ 
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   481
    "copying" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   482
        clone copy shallowCopy 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   483
    "dependents access" 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   484
        "canDiscardEdits" dependents "hasUnacceptedEdits" 
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   485
    "updating" 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   486
        "changed changed: okToChange update: windowIsClosing" "/ - not useful 
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   487
    "printing" 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   488
        fullPrintString isLiteral "longPrintString" printString storeString stringForReadout stringRepresentation 
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   489
    "class membership" 
1109
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
   490
        class isKindOf: #'isKindOf:orOf:' isMemberOf: respondsTo: respondsToArithmetic  
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   491
    "error handling" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   492
    "user interface" 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   493
        defaultBackgroundColor "defaultLabelForInspector" "fullScreenSize" 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   494
        initialExtent "modelWakeUp" "mouseUpBalk:" 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   495
        "newTileMorphRepresentative" "windowActiveOnFirstClick" "windowReqNewLabel:" 
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   496
    "system primitives"  
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   497
        instVarAt: instVarNamed: 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   498
    "private" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   499
    "associating" -> 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   500
    "converting" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   501
        as: asOrderedCollection asString 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   502
    "casing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   503
        caseOf: #'caseOf:otherwise:' 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   504
    "binding" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   505
        bindingOf: 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   506
    "macpal" 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   507
        contentsChanged "#'ifKindOf:thenDo:'" instanceVariableValues  
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   508
    "flagging" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   509
        flag: 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   510
    "translation support" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   511
    "objects from disk" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   512
    "finalization" 
1109
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
   513
    "ST/X converting"
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
   514
        literalArrayEncoding
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   515
    ) do: [:sel | Approved add: sel].
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   516
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   517
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   518
        #'at:add:' #'at:modify:' #'at:put:' #'basicAt:put:' "NOT instVar:at:"
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   519
    "message handling" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   520
        perform: 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   521
        #'perform:with:' #'perform:with:with:' #'perform:with:with:with:' #'perform:withArguments:' 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   522
        #'perform:withArguments:inSuperclass:'
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   523
        #'perform:orSendTo:' 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   524
    ) do: [:sel | AddAndRemove add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   525
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   526
"Boolean, True, False, UndefinedObject"  
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   527
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   528
    "logical operations" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   529
        & eqv: not xor: |
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   530
    "controlling" 
1961
bf11d495311b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1928
diff changeset
   531
        and: ifFalse: #'ifFalse:ifTrue:' ifTrue: #'ifTrue:ifFalse:' or: ifNil: ifNotNil:
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   532
    "copying" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   533
    "testing" 
2061
dedc1fe14e92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2060
diff changeset
   534
        isEmptyOrNil isNilOrEmptyCollection notEmptyOrNil
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   535
    ) do: [:sel | Approved add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   536
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   537
"Behavior" 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   538
    #("initialize-release"
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   539
    "accessing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   540
        compilerClass decompilerClass evaluatorClass format methodDict parserClass sourceCodeTemplate subclassDefinerClass
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   541
    "testing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   542
        instSize instSpec isBits isBytes isFixed isPointers isVariable isWeak isWords
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   543
    "copying"
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   544
    "printing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   545
        defaultNameStemForInstances printHierarchy
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   546
    "creating class hierarchy"
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   547
    "creating method dictionary"
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   548
    "instance creation" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   549
        basicNew basicNew: new new:
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   550
    "accessing class hierarchy" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   551
        allSubclasses #'allSubclassesWithLevelDo:startingLevel:' allSuperclasses subclasses superclass withAllSubclasses withAllSuperclasses
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   552
    "accessing method dictionary" 
1109
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
   553
        allSelectors changeRecordsAt: compiledMethodAt: #'compiledMethodAt:ifAbsent:' firstCommentAt: lookupSelector: selectors selectorsDo: selectorsWithArgs: 
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
   554
        "slow but useful ->" sourceCodeAt: sourceCodeAt:ifAbsent: sourceMethodAt: sourceMethodAt:ifAbsent:
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   555
    "accessing instances and variables" 
1109
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
   556
        allClassVarNames allInstVarNames allSharedPools classVarNames instVarNames instanceCount sharedPools 
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
   557
        "someInstance" subclassInstVarNames
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   558
    "testing class hierarchy" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   559
        inheritsFrom: kindOfSubclass
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   560
    "testing method dictionary" 
1109
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
   561
        canUnderstand: classThatUnderstands: hasMethods includesSelector: #'scopeHas:ifTrue:' 
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
   562
        whichClassIncludesSelector: 
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
   563
        whichSelectorsAccess: whichSelectorsReferTo: #'whichSelectorsReferTo:special:byte:' whichSelectorsStoreInto:
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   564
    "enumerating"
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   565
    "user interface"
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   566
    "private" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   567
        indexIfCompact
1109
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
   568
    "ST/X testing method dictionary" 
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
   569
        implements:  
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   570
    ) do: [:sel | Approved add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   571
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   572
"ClassDescription"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   573
    #(
1109
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
   574
    "initialize-release" 
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   575
    "accessing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   576
        classVersion isMeta name theNonMetaClass
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   577
    "copying" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   578
    "printing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   579
        classVariablesString instanceVariablesString sharedPoolsString
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   580
    "instance variables" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   581
        checkForInstVarsOK: 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   582
    "method dictionary" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   583
    "organization" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   584
        category organization whichCategoryIncludesSelector:
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   585
    "compiling" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   586
        acceptsLoggingOfCompilation wantsChangeSetLogging
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   587
    "fileIn/Out" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   588
        definition
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   589
    "private" 
1109
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
   590
    "ST/X queries" 
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
   591
        theMetaclass theNonMetaclass
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   592
    ) do: [:sel | Approved add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   593
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   594
"Class"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   595
    #(
1109
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
   596
    "initialize-release" 
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   597
    "accessing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   598
        classPool
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   599
    "testing"
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   600
    "copying" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   601
    "class name" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   602
    "instance variables" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   603
    "class variables" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   604
        classVarAt: classVariableAssociationAt:
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   605
    "pool variables" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   606
    "compiling" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   607
    "subclass creation" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   608
    "fileIn/Out" 
1109
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
   609
    "ST/X queries" 
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
   610
        nameSpace nameWithoutPrefix nameWithoutNameSpacePrefix
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   611
    ) do: [:sel | Approved add: sel]. 
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   612
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   613
"Metaclass"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   614
    #("initialize-release" 
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   615
    "accessing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   616
        isSystemDefined soleInstance
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   617
    "copying" "instance creation" "instance variables"  
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   618
    "pool variables" "class hierarchy"  "compiling"
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   619
    "fileIn/Out"  
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   620
        nonTrivial 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   621
    ) do: [:sel | Approved add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   622
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   623
"Context, BlockContext"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   624
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   625
        receiver client method receiver tempAt: 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   626
    "debugger access" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   627
        mclass pc selector sender shortStack sourceCode tempNames tempsAndValues
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   628
    "controlling"  "printing" "system simulation" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   629
    "initialize-release" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   630
    "accessing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   631
        hasMethodReturn home numArgs
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   632
    "evaluating" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   633
        value #'value:ifError:' #'value:value:' #'value:value:value:' #'value:value:value:value:' #'valueWithArguments:'
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   634
    "controlling"  "scheduling"  "instruction decoding"  "printing" "private"  "system simulation" ) do: [:sel | Approved add: sel].
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   635
        #(value: "<- Association has it as a store" 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   636
    ) do: [:sel | AddAndRemove add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   637
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   638
"Message"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   639
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   640
    "inclass, instance creation" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   641
        selector: #'selector:argument:' #'selector:arguments:'
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   642
    "accessing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   643
        argument argument: arguments sends:
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   644
    "printing" "sending" 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   645
    ) do: [:sel | Approved add: sel].
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   646
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   647
    "private" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   648
        #'setSelector:arguments:'
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   649
    ) do: [:sel | AddAndRemove add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   650
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   651
"Magnitude"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   652
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   653
    "comparing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   654
        < <= > >= #'between:and:'
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   655
    "testing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   656
        max: min: min:max: 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   657
    ) do: [:sel | Approved add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   658
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   659
"Date, Time"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   660
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   661
    "in class, instance creation" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   662
        fromDays: fromSeconds: fromString: #'newDay:month:year:' #'newDay:year:' today
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   663
    "in class, general inquiries" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   664
        dateAndTimeNow dayOfWeek: #'daysInMonth:forYear:' daysInYear: #'firstWeekdayOfMonth:year:' indexOfMonth: leapYear: nameOfDay: nameOfMonth:
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   665
    "accessing" 
1961
bf11d495311b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1928
diff changeset
   666
        day isLeapYear "leap" monthIndex monthName weekday year
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   667
    "arithmetic" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   668
        addDays: subtractDate: subtractDays:
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   669
    "comparing"
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   670
    "inquiries" 
1961
bf11d495311b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1928
diff changeset
   671
        dayOfMonth daysInMonth daysInYear daysLeftInMonth daysLeftInYear firstDayOfMonth previous:
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   672
    "converting" 
1961
bf11d495311b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1928
diff changeset
   673
        asSeconds asDays
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   674
    "printing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   675
        mmddyy mmddyyyy printFormat: printOn:format:
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   676
    "private" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   677
        firstDayOfMonthIndex: weekdayIndex 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   678
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   679
    "in class, instance creation" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   680
        fromSeconds: now 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   681
    "in class, general inquiries" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   682
        dateAndTimeFromSeconds: dateAndTimeNow millisecondClockValue millisecondsToRun: totalSeconds
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   683
    "accessing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   684
        hours minutes seconds
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   685
    "arithmetic" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   686
        addTime: subtractTime:
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   687
    "comparing"
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   688
    "printing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   689
        intervalString print24 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   690
    "converting"
1961
bf11d495311b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1928
diff changeset
   691
    "st/x" 
bf11d495311b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1928
diff changeset
   692
        dayOfWeek abbreviatedDayName abbreviatedMonthName 
bf11d495311b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1928
diff changeset
   693
        abbreviatedMonthNameForLanguage: dayCount dayInWeek dayInYear
bf11d495311b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1928
diff changeset
   694
        monthNameForLanguage: weekInYear daysSince: daysUntil: 
bf11d495311b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1928
diff changeset
   695
        asTimestamp asDate
bf11d495311b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1928
diff changeset
   696
        timeZoneDeltaInMinutes asTime asTimeDuration asMilliseconds
bf11d495311b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1928
diff changeset
   697
        asUtcTimestamp utcSecondsSince1901 printStringIso8601Format
bf11d495311b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1928
diff changeset
   698
        printString12HourFormat printString24HourFormat
bf11d495311b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1928
diff changeset
   699
        days utcOffset millisecondDeltaFrom: secondDeltaFrom:
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   700
    ) do: [:sel | Approved add: sel].
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   701
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   702
    "private" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   703
        hours: #'hours:minutes:seconds:' #'day:year:' 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   704
    ) do: [:sel | AddAndRemove add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   705
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   706
"Number"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   707
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   708
    "in class" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   709
        #'readFrom:base:' 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   710
    "arithmetic" 
2061
dedc1fe14e92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2060
diff changeset
   711
        * + - / // \\ abs negated quo: reciprocal rem: 
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   712
    "mathematical functions" 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   713
        arcCos arcSin arcTan arcTan: 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   714
        sin cos tan
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   715
        exp floorLog: ln log log: raisedTo: raisedToInteger: 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   716
        sqrt squared 
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   717
    "truncation and round off" 
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   718
        ceiling #'detentBy:atMultiplesOf:snap:' floor roundTo: roundUpTo: rounded truncateTo: truncated
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   719
    "comparing"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   720
        closeTo: closeTo:withEpsilon:
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   721
    "testing" 
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   722
        even isDivisibleBy: isInf isInfinite isNaN isZero negative odd positive sign strictlyPositive
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   723
    "converting" 
2285
3128849e7d2e changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 2248
diff changeset
   724
        @ asInteger asNumber asPoint asSmallAngleDegrees degreesToRadians radiansToDegrees 
3128849e7d2e changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 2248
diff changeset
   725
        asFixedPoint asFixedPoint: asFixedPointRoundedToScale asFixedPointRoundedToScale:
3128849e7d2e changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 2248
diff changeset
   726
        asFloat asFraction
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   727
    "intervals" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   728
        to: #'to:by:' 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   729
    "printing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   730
        printStringBase: storeStringBase: 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   731
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   732
    "ST/X in class"         
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   733
        #'readFrom:base:' 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   734
    "ST/X intervals"        
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   735
        downTo: #'downTo:by:'
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   736
    "ST/X printing"         
2061
dedc1fe14e92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2060
diff changeset
   737
        radixPrintStringRadix: printStringRadix: storeStringRadix: romanPrintString
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   738
    ) do: [:sel | Approved add: sel].
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   739
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   740
"Integer"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   741
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   742
    "in class" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   743
        primesUpTo:
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   744
    "testing" 
3316
d11917d0dca1 class: MethodFinder
Claus Gittinger <cg@exept.de>
parents: 2935
diff changeset
   745
        isPowerOfTwo isPowerOf: digitBytes isPrime nextPrime
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   746
    "arithmetic" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   747
        alignedTo:
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   748
    "comparing"
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   749
    "truncation and round off" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   750
        atRandom normalize
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   751
    "enumerating" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   752
        timesRepeat:
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   753
    "mathematical functions" 
2061
dedc1fe14e92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2060
diff changeset
   754
        degreeCos degreeSin factorial gcd: lcm: binco: take: primeFactors
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   755
    "bit manipulation" 
2061
dedc1fe14e92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2060
diff changeset
   756
        << >> allMask: anyMask: bitAnd: bitClear: bitInvert bitInvert32 bitOr: bitShift: bitXor: 
dedc1fe14e92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2060
diff changeset
   757
              highBit lowBit bitCount noMask:
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   758
    "converting" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   759
        asCharacter asColorOfDepth: asFloat asFraction asHexDigit
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   760
    "printing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   761
        asStringWithCommas hex hex8 radix:
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   762
    "system primitives" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   763
        lastDigit #'replaceFrom:to:with:startingAt:'
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   764
    "private" "benchmarks" 
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   765
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   766
    "ST/X printing"       
2061
dedc1fe14e92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2060
diff changeset
   767
        hexPrintString 
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   768
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   769
    ) do: [:sel | Approved add: sel].
1106
50a16e11b73a more st/x messages
Claus Gittinger <cg@exept.de>
parents: 1104
diff changeset
   770
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   771
"SmallInteger, LargeNegativeInteger, LargePositiveInteger"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   772
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   773
    "arithmetic" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   774
    "bit manipulation" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   775
    "testing" "comparing" "copying" "converting" "printing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   776
    "system primitives" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   777
        digitAt: digitLength 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   778
    "private" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   779
        #'fromString:radix:' 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   780
    ) do: [:sel | Approved add: sel].
2059
9e0592033093 allow search for collection results
Claus Gittinger <cg@exept.de>
parents: 2058
diff changeset
   781
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   782
    #(
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   783
        #'digitAt:put:'
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   784
    ) do: [:sel | AddAndRemove add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   785
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   786
"Float"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   787
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   788
    "arithmetic"
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   789
    "mathematical functions" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   790
        reciprocalFloorLog: reciprocalLogBase2 timesTwoPower:
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   791
    "comparing" "testing"
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   792
    "truncation and round off" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   793
        exponent fractionPart integerPart significand significandAsInteger
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   794
    "converting" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   795
        asApproximateFraction asIEEE32BitWord asTrueFraction
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   796
    "copying"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   797
    ) do: [:sel | Approved add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   798
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   799
"Fraction, Random"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   800
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   801
        denominator numerator reduced next nextValue
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   802
    ) do: [:sel | Approved add: sel].
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   803
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   804
        #'setNumerator:denominator:'
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   805
    ) do: [:sel | AddAndRemove add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   806
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   807
"Collection"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   808
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   809
    "accessing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   810
        anyOne
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   811
    "testing" 
3486
e1b722d5142b class: MethodFinder
Claus Gittinger <cg@exept.de>
parents: 3444
diff changeset
   812
        includes: includesAllOf: includesAnyOf: includesSubstringAnywhere: 
e1b722d5142b class: MethodFinder
Claus Gittinger <cg@exept.de>
parents: 3444
diff changeset
   813
        isEmpty notEmpty isSequenceable occurrencesOf:
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   814
    "enumerating" 
3486
e1b722d5142b class: MethodFinder
Claus Gittinger <cg@exept.de>
parents: 3444
diff changeset
   815
        collect: #'collect:thenSelect:' count: contains:
e1b722d5142b class: MethodFinder
Claus Gittinger <cg@exept.de>
parents: 3444
diff changeset
   816
        detect: #'detect:ifNone:' detectMax: detectMin: detectSum: 
e1b722d5142b class: MethodFinder
Claus Gittinger <cg@exept.de>
parents: 3444
diff changeset
   817
        #'inject:into:' reject: select: #'select:thenCollect:'  map:
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   818
    "converting" 
3486
e1b722d5142b class: MethodFinder
Claus Gittinger <cg@exept.de>
parents: 3444
diff changeset
   819
        asArray asBag asCharacterSet asSet asSortedArray asSortedCollection asSortedCollection:
e1b722d5142b class: MethodFinder
Claus Gittinger <cg@exept.de>
parents: 3444
diff changeset
   820
        asStringWith: asNilIfEmpty asOrderedCollection
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   821
    "printing"
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   822
    "private" 
3486
e1b722d5142b class: MethodFinder
Claus Gittinger <cg@exept.de>
parents: 3444
diff changeset
   823
        maxSize largest: smallest: 
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   824
    "arithmetic"
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   825
    "math functions" 
3486
e1b722d5142b class: MethodFinder
Claus Gittinger <cg@exept.de>
parents: 3444
diff changeset
   826
        average max median min range sum product abs minMax
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   827
    ) do: [:sel | Approved add: sel].
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   828
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   829
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   830
    "adding" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   831
        add: addAll: addIfNotPresent:
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   832
    "removing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   833
        remove: #'remove:ifAbsent:' removeAll: removeAllFoundIn: removeAllSuchThat: #'remove:ifAbsent:'
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   834
    ) do: [:sel | AddAndRemove add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   835
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   836
"SequenceableCollection"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   837
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   838
    "comparing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   839
        hasEqualElements:
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   840
    "accessing" allButFirst allButLast at:ifAbsent: atAll: atPin: atRandom: atWrap: 
3486
e1b722d5142b class: MethodFinder
Claus Gittinger <cg@exept.de>
parents: 3444
diff changeset
   841
        fifth first fourth last second sixth third  nth:
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   842
        identityIndexOf: #'identityIndexOf:startingAt:' #'identityIndexOf:ifAbsent:' #'identityIndexOf:startingAt:ifAbsent:'
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   843
        indexOf:         #'indexOf:startingAt:'         #'indexOf:ifAbsent:'     #'indexOf:startingAt:ifAbsent:' 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   844
        lastIndexOf:     #'lastIndexOf:startingAt:'     #'lastIndexOf:ifAbsent:' #'lastIndexOf:startingAt:ifAbsent:' 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   845
        #'indexOfSubCollection:' 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   846
        #'indexOfSubCollection:ifAbsent:' 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   847
        #'indexOfSubCollection:startingAt:' 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   848
        #'indexOfSubCollection:startingAt:ifAbsent:' 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   849
        #'lastIndexOfSubCollection:' 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   850
        #'lastIndexOfSubCollection:ifAbsent:' 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   851
        #'lastIndexOfSubCollection:startingAt:' 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   852
        #'lastIndexOfSubCollection:startingAt:ifAbsent:' 
1107
08b382d1c128 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1106
diff changeset
   853
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   854
    "removing"
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   855
    "copying" 
4465
37feb996bde5 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4463
diff changeset
   856
        , #'copyAfterLast:' #'copyAt:put:' 
37feb996bde5 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4463
diff changeset
   857
          #'copyFrom:to:' 
37feb996bde5 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4463
diff changeset
   858
          #'copyReplaceAll:with:' #'copyReplaceFrom:to:with:' 
37feb996bde5 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4463
diff changeset
   859
          #'copyUpTo:' #'copyUpToLast:' 
37feb996bde5 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4463
diff changeset
   860
          #'copyWith:' #'copyWithout:' #'copyWithoutAll:' 
37feb996bde5 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4463
diff changeset
   861
          #'forceTo:paddingWith:' 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   862
        "shuffled -- not useful"
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   863
        sortBy:
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   864
    "enumerating" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   865
        collectWithIndex: findFirst: findLast: pairsCollect: #'with:collect:' withIndexCollect: polynomialEval:
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   866
    "converting" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   867
        asArray asDictionary asFloatArray asIntegerArray asStringWithCr asWordArray reversed
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   868
    "private" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   869
        #'copyReplaceAll:with:asTokens:' 
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   870
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   871
    "ST/X copying"        
4465
37feb996bde5 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4463
diff changeset
   872
        copyButLast: copyLast:  copyFrom: copyTo: #'copyFrom:count:' #'copyBetween:and:caseSensitive:'
37feb996bde5 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4463
diff changeset
   873
        last: first:
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   874
        splitBy:
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   875
    "ST/X testing"        
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   876
        longestCommonPrefix
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   877
    ) do: [:sel | Approved add: sel].
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   878
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   879
    #( 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   880
        swap:with:
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   881
    ) do: [:sel | AddAndRemove add: sel].
1106
50a16e11b73a more st/x messages
Claus Gittinger <cg@exept.de>
parents: 1104
diff changeset
   882
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   883
"ArrayedCollection, Bag"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   884
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   885
    "private" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   886
        defaultElement 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   887
    "sorting" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   888
        isSorted
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   889
    "accessing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   890
        cumulativeCounts sortedCounts sortedElements 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   891
    "testing" "adding" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   892
        #'add:withOccurrences:' 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   893
    "removing" "enumerating" 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   894
    ) do: [:sel | Approved add: sel].
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   895
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   896
    #( 
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   897
        #'mergeSortFrom:to:by:' sort sort: add: #'add:withOccurrences:'
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   898
    "private" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   899
        setDictionary 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   900
    ) do: [:sel | AddAndRemove add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   901
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   902
"Other messages that modify the receiver"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   903
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   904
        #'atAll:put:' #'atAll:putAll:' atAllPut: #'atWrap:put:' 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   905
        #'replaceAll:with:' #'replaceFrom:to:with:'  removeFirst removeLast
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   906
    "ST/X filling & replacing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   907
        reverse
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   908
    ) do: [:sel | AddAndRemove add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   909
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   910
    self initialize2.
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   911
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   912
"
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   913
MethodFinder new initialize.
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   914
MethodFinder new organizationFiltered: Set
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   915
"
1106
50a16e11b73a more st/x messages
Claus Gittinger <cg@exept.de>
parents: 1104
diff changeset
   916
2285
3128849e7d2e changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 2248
diff changeset
   917
    "Modified: / 02-08-2010 / 13:33:57 / cg"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   918
    "Modified: / 08-06-2019 / 17:15:42 / Claus Gittinger"
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   919
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   920
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   921
initialize2
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   922
    "Additional methods we are allowed to use.   
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   923
    (invoked by MethodFinder new initialize)"
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   924
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   925
"Set"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   926
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   927
    "in class" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   928
        sizeFor:
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   929
    "testing" "adding" "removing" "enumerating"
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   930
    "private" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   931
        array findElementOrNil: 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   932
    "accessing" 
3690
04cbf4ab1df0 class: MethodFinder
Claus Gittinger <cg@exept.de>
parents: 3622
diff changeset
   933
        "/ someElement anElement anyOne
04cbf4ab1df0 class: MethodFinder
Claus Gittinger <cg@exept.de>
parents: 3622
diff changeset
   934
        anElement anyOne
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   935
    ) do: [:sel | Approved add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   936
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   937
"Dictionary, IdentityDictionary, IdentitySet"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   938
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   939
    "accessing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   940
        associationAt: #'associationAt:ifAbsent:' #'at:ifPresent:' keyAtIdentityValue: #'keyAtIdentityValue:ifAbsent:' keyAtValue: #'keyAtValue:ifAbsent:' keys
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   941
    "testing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   942
        includesKey: 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   943
    ) do: [:sel | Approved add: sel].
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   944
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   945
        removeKey: #'removeKey:ifAbsent:'
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   946
    ) do: [:sel | AddAndRemove add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   947
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   948
"LinkedList, Interval, MappedCollection"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   949
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   950
    "in class"  
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   951
        #'from:to:' #'from:to:by:'
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   952
    "accessing" 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   953
        contents
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   954
    ) do: [:sel | Approved add: sel].
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   955
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   956
    "adding" 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   957
        addFirst: addLast:
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   958
    ) do: [:sel | AddAndRemove add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   959
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   960
"OrderedCollection, SortedCollection"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   961
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   962
    "accessing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   963
        after: before:
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   964
    "copying" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   965
        copyEmpty
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   966
    "adding"  
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   967
        growSize
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   968
    "removing" "enumerating" "private" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   969
    "accessing" 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   970
        sortBlock
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   971
    ) do: [:sel | Approved add: sel].
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   972
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   973
    "adding" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   974
        #'add:after:' #'add:afterIndex:' #'add:before:' addAllFirst: addAllLast: addFirst: addLast:
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   975
    "removing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   976
        removeAt: removeFirst removeLast
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   977
    "accessing" 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   978
        sortBlock:
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   979
    ) do: [:sel | AddAndRemove add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   980
40d9ddd1f510 initial checkin
james
parents:
diff changeset
   981
"Character"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   982
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   983
    "in class, instance creation" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   984
        allCharacters digitValue: new separators
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   985
    "accessing untypeable characters" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   986
        backspace cr enter lf linefeed nbsp newPage space tab
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   987
    "constants" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   988
        alphabet characterTable
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   989
    "accessing" 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   990
        asciiValue codePoint digitValue
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   991
    "comparing"
2107
903ad42a8ea7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2061
diff changeset
   992
    "queries"
903ad42a8ea7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2061
diff changeset
   993
        bitsPerCharacter
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
   994
    "testing" 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   995
        isAlphaNumeric isDigit isDigitRadix: 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   996
        isLetter isLetterOrUnderline isLetterOrDigitOrUnderline 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   997
        isLowercase isUppercase isSafeForHTTP isSeparator isSpecial isControlCharacter
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   998
        isVowel tokenish 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
   999
        isNationalAlphaNumeric isNationalDigit isNationalLetter isGreekLetter
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1000
        isCharacter
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1001
    "copying"
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1002
    "converting" 
2107
903ad42a8ea7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2061
diff changeset
  1003
        asIRCLowercase asLowercase asUppercase rot13 rot:
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1004
    ) do: [:sel | Approved add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1005
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1006
"String"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1007
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1008
    "in class, instance creation" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1009
        crlf fromPacked:
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1010
    "primitives" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1011
        #'findFirstInString:inSet:startingAt:' #'indexOfAscii:inString:startingAt:'      "internet" valueOfHtmlEntity:
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1012
    "accessing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1013
        byteAt: endsWithDigit #'findAnySubStr:startingAt:' findBetweenSubStrs: 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1014
        #'findDelimiters:startingAt:' 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1015
        #'findString:startingAt:' #'findString:startingAt:caseSensitive:' 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1016
        findTokens: #'findTokens:includes:' #'findTokens:keep:' 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1017
        includesSubString: #'includesSubstring:caseSensitive:' 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1018
        #'indexOf:startingAt:' 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1019
        indexOfAnyOf: #'indexOfAnyOf:ifAbsent:' #'indexOfAnyOf:startingAt:' #'indexOfAnyOf:startingAt:ifAbsent:' 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1020
        lineCorrespondingToIndex: lineCount lineNumber: 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1021
        #'skipAnySubStr:startingAt:' #'skipDelimiters:startingAt:' 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1022
        startsWithDigit endsWithDigit
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1023
    "comparing" 
1109
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  1024
        alike: beginsWith: caseSensitiveLessOrEqual: charactersExactlyMatching: compare: crc16 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1025
        startsWith: startsWithAnyOf: endsWith: endsWithAnyOf: sameAs: 
1109
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  1026
        #'startingAt:match:startingAt:'
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1027
    "copying" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1028
        #'copyReplaceTokens:with:' #'padded:to:with:'
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1029
    "converting" 
3951
bab7dcb06041 #BUGFIX
mawalch
parents: 3872
diff changeset
  1030
        asByteArray asDate asDisplayText asFilename asHtml asLegalSelector asPacked asParagraph asText asTime asUnHtml asUrl asUrlRelativeTo: 
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1031
        #capitalized compressWithTable: contractTo: correctAgainst: 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1032
        encodeForHTTP initialIntegerOrNil keywords quoted sansPeriodSuffix 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1033
        splitInteger stemAndNumericSuffix substrings surroundedBySingleQuotes 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1034
        truncateWithElipsisTo: withBlanksTrimmed withFirstCharacterDownshifted 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1035
        withNoLineLongerThan: withSeparatorsCompacted withoutLeadingDigits 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1036
        withoutTrailingBlanks
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1037
    "displaying" "printing"
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1038
    "system primitives" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1039
        #'compare:with:collated:' 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1040
    "Celeste" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1041
        withCRs
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1042
    "internet" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1043
        decodeMimeHeader decodeQuotedPrintable replaceHtmlCharRefs unescapePercents withInternetLineEndings withSqueakLineEndings withoutQuoting
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1044
    "testing" 
2108
7f166aebe418 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2107
diff changeset
  1045
        isAllSeparators lastSpacePosition isBlank isEmpty
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1046
    "paragraph support" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1047
        indentationIfBlank:
1109
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  1048
    "arithmetic" 
2107
903ad42a8ea7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2061
diff changeset
  1049
    "queries"
2108
7f166aebe418 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2107
diff changeset
  1050
        bitsPerCharacter contains8BitCharacters knownAsSymbol
1109
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  1051
    "ST/X copying"
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  1052
        paddedTo: paddedTo:with: centerPaddedTo: centerPaddedTo:with:
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  1053
        decimalPaddedTo:and:at:
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  1054
        leftPaddedTo: leftPaddedTo:with:
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  1055
        chopTo: contractAtBeginningTo: contractAtEndTo: contractTo:
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  1056
    "ST/X comparing"
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  1057
        compareWith: sameCharacters: sameEmphasisAs: sameStringAndEmphasisAs:
4443
e13a75778762 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4442
diff changeset
  1058
        match: match:caseSensitive: matches: matches:caseSensitive:
e13a75778762 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4442
diff changeset
  1059
        matchesRegex: allRegexMatches: prefixMatchesRegex:
1109
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  1060
    "ST/X searching"
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  1061
        indexOfSeparator indexOfSeparatorStartingAt:
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  1062
        lastIndexOfSeparator lastIndexOfSeparatorStartingAt:
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  1063
        indexOfNonSeparatorStartingAt:
2108
7f166aebe418 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2107
diff changeset
  1064
    "ST/X printing" 
2109
785005ccdb1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2108
diff changeset
  1065
        sscanf:
785005ccdb1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2108
diff changeset
  1066
        printf:
1109
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  1067
    "ST/X converting" 
4442
4d9e621c8cdb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4441
diff changeset
  1068
        utf8Encoded utf8Decoded
1109
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  1069
        asUppercaseFirst 
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  1070
        asCollectionOfWords asCollectionOfLines 
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  1071
        asCollectionOfSubstringsSeparatedBy: asCollectionOfSubstringsSeparatedByAny:
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  1072
    "Ansi"
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  1073
        addLineDelimiters
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  1074
    ) do: [:sel | Approved add: sel].
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1075
    #(
4442
4d9e621c8cdb #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4441
diff changeset
  1076
        #'byteAt:put:' "translateToLowercase" 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1077
    ) do: [:sel | AddAndRemove add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1078
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1079
"Symbol"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1080
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1081
    "in class, private" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1082
        hasInterned:ifTrue:
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1083
    "access" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1084
        morePossibleSelectorsFor: possibleSelectorsFor: selectorsContaining: #'thatStarts:skipping:'
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1085
    "accessing" "comparing" "copying" "converting" "printing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1086
    "testing" 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1087
        isInfix isKeyword isPvtSelector isUnary
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1088
    ) do: [:sel | Approved add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1090
"Array"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1091
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1092
    "comparing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1093
    "converting" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1094
        evalStrings 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1095
    "printing" "private" 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1096
        hasLiteralSuchThat:
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1097
    ) do: [:sel | Approved add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1098
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1099
"Array2D"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1100
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1101
    "access" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1102
        #'at:at:' atCol: #'atCol:put:' atRow: extent #'extent:fromArray:' height width #'width:height:type:'
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1103
    ) do: [:sel | Approved add: sel].
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1104
    #(
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1105
        #'at:at:add:' #'at:at:put:' #'atRow:put:' 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1106
    ) do: [:sel | AddAndRemove add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1107
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1108
"ByteArray"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1109
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1110
    "accessing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1111
        doubleWordAt: wordAt: 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1112
    "platform independent access" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1113
        #'longAt:bigEndian:' #'shortAt:bigEndian:' #'unsignedLongAt:bigEndian:' #'unsignedShortAt:bigEndian:' 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1114
    "converting"
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1115
    ) do: [:sel | Approved add: sel].
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1116
    #(
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1117
        #'doubleWordAt:put:' #'wordAt:put:' 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1118
        #'longAt:put:bigEndian:' #'shortAt:put:bigEndian:' 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1119
        #'unsignedLongAt:put:bigEndian:' #'unsignedShortAt:put:bigEndian:'
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1120
    ) do: [:sel | AddAndRemove add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1121
4129
caab684796a7 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4026
diff changeset
  1122
"FloatArray"            "Don't know what happens when prims not here"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1123
false ifTrue: [
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1124
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1125
    "accessing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1126
    "arithmetic" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1127
        *= += -= /=
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1128
    "comparing"
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1129
    "primitives-plugin" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1130
        primAddArray: primAddScalar: primDivArray: primDivScalar: primMulArray: primMulScalar: primSubArray: primSubScalar:
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1131
    "primitives-translated" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1132
        #'primAddArray:withArray:from:to:' #'primMulArray:withArray:from:to:' #'primSubArray:withArray:from:to:'
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1133
    "converting" "private" "user interface"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1134
    ) do: [:sel | Approved add: sel].
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1135
].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1136
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1137
"IntegerArray, WordArray"
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1138
"RunArray"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1139
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1140
    "in class, instance creation" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1141
        #'runs:values:' scanFrom:
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1142
    "accessing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1143
        runLengthAt: 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1144
    "adding" "copying"
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1145
    "private" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1146
        runs values
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1147
    ) do: [:sel | Approved add: sel].
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1148
    #(
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1149
        coalesce #'addLast:times:' #'repeatLast:ifEmpty:' repeatLastIfEmpty:
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1150
    ) do: [:sel | AddAndRemove add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1151
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1152
"Stream  -- many operations change its state"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1153
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1154
    "testing" 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1155
        atEnd
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1156
    ) do: [:sel | Approved add: sel].
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1157
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1158
    "accessing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1159
        next: nextMatchAll: nextMatchFor: upToEnd
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1160
        #'next:put:' nextPut: nextPutAll: 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1161
    "printing" print: printHtml:
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1162
    ) do: [:sel | AddAndRemove add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1163
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1164
"PositionableStream"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1165
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1166
    "accessing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1167
        contentsOfEntireFile originalContents peek peekFor: "testing"
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1168
    "positioning" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1169
        position 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1170
    ) do: [:sel | Approved add: sel].
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1171
    #(
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1172
        nextDelimited: nextLine upTo: position: reset resetContents setToEnd 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1173
        skip: skipTo: upToAll:
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1174
        through: throughAll: next next:
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1175
    ) do: [:sel | AddAndRemove add: sel].
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1176
        "Because it is so difficult to test the result of an operation on a Stream 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1177
         (you have to supply another Stream in the same state), 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1178
         we don't support Streams beyond the basics.  
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1179
         We want to find the messages that convert Streams to other things."
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1180
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1181
"ReadWriteStream"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1182
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1183
    "file status" 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1184
        closed
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1185
    ) do: [:sel | Approved add: sel].
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1186
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1187
    "accessing" 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1188
        next: on: 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1189
    ) do: [:sel | AddAndRemove add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1190
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1191
"WriteStream"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1192
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1193
    "in class, instance creation" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1194
        on:from:to: with: with:from:to:
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1195
    ) do: [:sel | Approved add: sel].
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1196
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1197
    "positioning" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1198
        resetToStart
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1199
    "character writing" 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1200
        crtab crtab:
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1201
    ) do: [:sel | AddAndRemove add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1202
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1203
"LookupKey, Association, Link"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1204
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1205
    "accessing" 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1206
        key nextLink
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1207
    ) do: [:sel | Approved add: sel].
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1208
    #(
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1209
        key: #'key:value:' nextLink:
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1210
    ) do: [:sel | AddAndRemove add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1211
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1212
"Point"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1213
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1214
    "in class, instance creation" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1215
        #'r:degrees:' #'x:y:'
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1216
    "accessing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1217
        x y 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1218
    "comparing" "arithmetic" "truncation and round off"
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1219
    "polar coordinates" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1220
        degrees r theta
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1221
    "point functions" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1222
        bearingToPoint: crossProduct: dist: dotProduct: eightNeighbors #'flipBy:centerAt:' fourNeighbors grid: 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1223
        #'nearestPointAlongLineFrom:to:' #'nearestPointOnLineFrom:to:' 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1224
        normal normalized octantOf: 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1225
        #'onLineFrom:to:' #'onLineFrom:to:within:' 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1226
        quadrantOf: #'rotateBy:centerAt:' transposed unitVector
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1227
    "converting" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1228
        asFloatPoint asIntegerPoint corner: extent: rect:
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1229
    "transforming" 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1230
        adhereTo: #'rotateBy:about:' scaleBy: #'scaleFrom:to:' translateBy: 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1231
    "copying"
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1232
    "interpolating" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1233
        #'interpolateTo:at:'
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1234
    ) do: [:sel | Approved add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1235
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1236
"Rectangle"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1237
    #(
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1238
    "in class, instance creation" 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1239
        #'center:extent:' encompassing: #'left:right:top:bottom:' 
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1240
        merging: #'origin:corner:' #'origin:extent:' 
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1241
    "accessing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1242
        area bottom bottomCenter bottomLeft bottomRight boundingBox center corner corners innerCorners 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1243
        left leftCenter origin right rightCenter top topCenter topLeft topRight
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1244
    "comparing"
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1245
    "rectangle functions" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1246
        #'adjustTo:along:' amountToTranslateWithin: areasOutside: #'bordersOn:along:' encompass: 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1247
        expandBy: extendBy: #'forPoint:closestSideDistLen:' 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1248
        insetBy: #'insetOriginBy:cornerBy:' intersect: 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1249
        merge: pointNearestTo: quickMerge: #'rectanglesAt:height:' 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1250
        sideNearestTo: translatedToBeWithin: 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1251
        withBottom: withHeight: withLeft: withRight: #'withSide:setTo:' withTop: withWidth:
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1252
    "testing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1253
        containsPoint: containsRect: hasPositiveExtent intersects: isTall isWide
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1254
    "truncation and round off"
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1255
    "transforming" 
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1256
        #'align:with:' centeredBeneath: newRectFrom: squishedWithin: 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1257
    "copying"
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1258
    ) do: [:sel | Approved add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1259
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1260
"Color"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1261
    #(
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1262
    "in class, instance creation" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1263
        colorFrom: #'colorFromPixelValue:depth:' fromRgbTriplet: gray: #'h:s:v:' #'r:g:b:' #'r:g:b:alpha:' #'r:g:b:range:'
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1264
    "ST/X in class, instance creation" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1265
        colorNamed:
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1266
    "named colors" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1267
        black blue brown cyan darkGray gray green lightBlue lightBrown lightCyan lightGray lightGreen lightMagenta lightOrange lightRed lightYellow 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1268
        magenta orange red transparent veryDarkGray veryLightGray veryVeryDarkGray veryVeryLightGray white yellow
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1269
    "other" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1270
        colorNames indexedColors pixelScreenForDepth: quickHighLight:
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1271
    "access" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1272
        alpha blue brightness green hue luminance red saturation
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1273
    "equality"
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1274
    "queries" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1275
        isBitmapFill isBlack isGray isSolidFill isTranslucent isTranslucentColor
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1276
    "transformations" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1277
        alpha: dansDarker darker lighter #'mixed:with:' muchLighter slightlyDarker slightlyLighter veryMuchLighter #'alphaMixed:with:'
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1278
    "groups of shades" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1279
        darkShades: lightShades: #'mix:shades:' wheel:
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1280
    "printing" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1281
        shortPrintString
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1282
    "other" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1283
        colorForInsets rgbTriplet
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1284
    "conversions" 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1285
        asB3DColor asColor balancedPatternForDepth: bitPatternForDepth: closestPixelValue1 closestPixelValue2 closestPixelValue4 closestPixelValue8 dominantColor 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1286
        halfTonePattern1 halfTonePattern2 indexInMap: pixelValueForDepth: #'pixelWordFor:filledWith:' pixelWordForDepth: scaledPixelValue32
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1287
    "private" 
1109
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  1288
        privateAlpha privateBlue privateGreen privateRGB privateRed 
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  1289
    "copying"
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1290
    "ST/X access" 
1109
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  1291
        redByte greenByte blueByte alphaByte rgbValue almostSameAs:
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1292
    ) do: [:sel | Approved add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1293
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1294
"       For each selector that requires a block argument, add (selector argNum) 
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1295
                to the set Blocks."
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1296
"ourClasses _ #(Object Boolean True False UndefinedObject Behavior ClassDescription Class Metaclass MethodContext BlockContext Message Magnitude Date Time Number Integer 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1297
                SmallInteger LargeNegativeInteger LargePositiveInteger Float Fraction Random Collection SequenceableCollection ArrayedCollection Bag Set 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1298
                Dictionary IdentityDictionary IdentitySet LinkedList Interval MappedCollection OrderedCollection SortedCollection Character String Symbol Array 
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1299
                Array2D ByteArray FloatArray IntegerArray WordArray RunArray Stream PositionableStream ReadWriteStream WriteStream LookupKey Association Link Point Rectangle Color).
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1300
ourClasses do: [:clsName | cls _ Smalltalk at: clsName.
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1301
        (cls selectors) do: [:aSel |
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1302
                ((Approved includes: aSel) or: [AddAndRemove includes: aSel]) ifTrue: [
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1303
                        (cls formalParametersAt: aSel) withIndexDo: [:tName :ind |
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1304
                                (tName endsWith: 'Block') ifTrue: [
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1305
                                        Blocks add: (Array with: aSel with: ind)]]]]].
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1306
"
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1307
    #(
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1308
        (timesRepeat: 1 ) (indexOf:ifAbsent: 2 ) (pairsCollect: 1 ) (#'mergeSortFrom:to:by:' 3 ) 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1309
        (#'ifNotNil:ifNil:' 1 ) (#'ifNotNil:ifNil:' 2 ) (ifNil: 1 ) (#'at:ifAbsent:' 2 ) 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1310
        (#'ifNil:ifNotNil:' 1 ) (#'ifNil:ifNotNil:' 2 ) (ifNotNil: 1 ) (#'at:modify:' 2 ) 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1311
        (#'identityIndexOf:ifAbsent:' 2 ) (sort: 1 ) (sortBlock: 1 ) 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1312
        (detectMax: 1 ) (repeatLastIfEmpty: 1 ) (#'allSubclassesWithLevelDo:startingLevel:' 1 ) 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1313
        (#'keyAtValue:ifAbsent:' 2 ) (in: 1 ) 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1314
        (ifTrue: 1 ) (or: 1 ) (select: 1 ) (inject:into: 2 ) (#'ifKindOf:thenDo:' 2 ) 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1315
        (#'forPoint:closestSideDistLen:' 2 ) (#'value:ifError:' 2 ) (selectorsDo: 1 ) 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1316
        (removeAllSuchThat: 1 ) (#'keyAtIdentityValue:ifAbsent:' 2 ) (detectMin: 1 ) 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1317
        (#'detect:ifNone:' 1 ) (#'ifTrue:ifFalse:' 1 ) (#'ifTrue:ifFalse:' 2 ) 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1318
        (#'detect:ifNone:' 2 ) (hasLiteralSuchThat: 1 ) (#'indexOfAnyOf:ifAbsent:' 2 ) 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1319
        (reject: 1 ) (newRectFrom: 1 ) (#'removeKey:ifAbsent:' 2 ) (#'at:ifPresent:' 2 ) 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1320
        (#'associationAt:ifAbsent:' 2 ) (withIndexCollect: 1 ) (#'repeatLast:ifEmpty:' 2 ) 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1321
        (findLast: 1 ) (#'indexOf:startingAt:ifAbsent:' 3 ) (#'remove:ifAbsent:' 2 ) 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1322
        (#'ifFalse:ifTrue:' 1 ) (#'ifFalse:ifTrue:' 2 ) (#'caseOf:otherwise:' 2 ) (count: 1 ) (collect: 1 ) (sortBy: 1 ) (and: 1 ) (asSortedCollection: 1 ) 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1323
        (#'with:collect:' 2 ) (#'sourceCodeAt:ifAbsent:' 2 ) (detect: 1 ) (#'scopeHas:ifTrue:' 2 ) (collectWithIndex: 1 ) (#'compiledMethodAt:ifAbsent:' 2 ) 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1324
        (bindWithTemp: 1 ) (detectSum: 1 ) (#'indexOfSubCollection:startingAt:ifAbsent:' 3 ) (findFirst: 1 ) (#'sourceMethodAt:ifAbsent:' 2 ) (#'collect:thenSelect:' 1 ) 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1325
        (#'collect:thenSelect:' 2 ) (#'select:thenCollect:' 1 ) (#'select:thenCollect:' 2 ) (ifFalse: 1 ) (#'indexOfAnyOf:startingAt:ifAbsent:' 3 ) (#'indentationIfBlank:' 1 ) 
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1326
    ) do: [:anArray |
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1327
        Blocks add: anArray
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1328
    ].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1329
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1330
    #(
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1331
        (ifFalse: 1 )
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1332
        (ifTrue: 1 )
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1333
        (#'ifFalse:ifTrue:' 1 ) (#'ifFalse:ifTrue:' 2 )
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1334
        (#'ifTrue:ifFalse:' 1 ) (#'ifTrue:ifFalse:' 2 )
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1335
    ) do: [:anArray |
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1336
        BlocksOptional add: anArray
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1337
    ].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1338
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1339
"
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1340
MethodFinder new initialize.
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1341
MethodFinder new organizationFiltered: TranslucentColor class 
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1342
"
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1343
"Do not forget class messages for each of these classes"
1108
c3371dc1b8a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1107
diff changeset
  1344
4441
29ef162823ce #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
  1345
    "Modified: / 13-11-2001 / 19:28:41 / cg"
4443
e13a75778762 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4442
diff changeset
  1346
    "Modified: / 08-06-2019 / 17:30:19 / Claus Gittinger"
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1347
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1348
2895
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1349
load:dataWithAnswers 
4504
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1350
    "prepare to find a function that takes the data and gives the answers.  
4502
0115c68381ad #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4497
diff changeset
  1351
     Odd list entries are data for it, even ones are the answers.  
0115c68381ad #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4497
diff changeset
  1352
     nil input means data and answers were supplied already."
0115c68381ad #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4497
diff changeset
  1353
0115c68381ad #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4497
diff changeset
  1354
    "  (MethodFinder new) 
0115c68381ad #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4497
diff changeset
  1355
            load: #( (4 3) 7  
0115c68381ad #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4497
diff changeset
  1356
                     (-10 5) -5  
0115c68381ad #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4497
diff changeset
  1357
                     (-3 11) 8
0115c68381ad #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4497
diff changeset
  1358
                   );
0115c68381ad #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4497
diff changeset
  1359
            findMessage"
2895
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1360
    
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1361
    dataWithAnswers 
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1362
        ifNotNil:[
4503
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1363
            "/ data := dataWithAnswers selectIndices:#odd.
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1364
            "/ answers := dataWithAnswers selectIndices:#even.
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1365
            "/ self assert:(data size == answers size).
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1366
2895
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1367
            data := Array new:dataWithAnswers size // 2.
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1368
            1 to:data size do:[:ii | 
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1369
                data at:ii put:(dataWithAnswers at:ii * 2 - 1)
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1370
            ].
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1371
            answers := Array new:data size.
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1372
            1 to:answers size do:[:ii | 
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1373
                answers at:ii put:(dataWithAnswers at:ii * 2)
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1374
            ]
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1375
        ].
4503
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1376
2895
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1377
    data do:[:list | 
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1378
        (list isSequenceable) ifFalse:[
4503
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1379
            ^ self warn:'data items (first and third) are not Arrays'
2895
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1380
        ].
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1381
    ].
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1382
    argMap := (1 to:data first size) asArray.
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1383
    data do:[:list | 
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1384
        list size = argMap size ifFalse:[
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1385
            self warn:'data arrays must all be the same size'
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1386
        ]
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1387
    ].
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1388
    argMap size > 4 ifTrue:[
4503
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1389
        self warnTooManyArguments
2895
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1390
    ].
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1391
     "Really only test receiver and three args."
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1392
    thisData := data copy.
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1393
    mapStage := mapList := nil.
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1394
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1395
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1396
noteDangerous
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1397
        "Remember the methods with really bad side effects."
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1398
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1399
        Dangerous _ Set new.
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1400
"Object accessing, testing, copying, dependent access, macpal, flagging"
4252
6f2f15e5248d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
  1401
        #(addInstanceVarNamed:withValue:  
6f2f15e5248d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
  1402
          copyAddedStateFrom: veryDeepCopy veryDeepCopyWith: veryDeepFixupWith: veryDeepInner: addDependent: evaluate:wheneverChangeIn: codeStrippedOut: playSoundNamed: isThisEverCalled isThisEverCalled: logEntry logExecution logExit)
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1403
                do: [:sel | Dangerous add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1404
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1405
"Object error handling"
4252
6f2f15e5248d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
  1406
        #(cannotInterpret: caseError confirm: confirm:orCancel: doesNotUnderstand: error: 
6f2f15e5248d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
  1407
          halt halt: haltIfNil haltIfTrue haltIfFalse 
6f2f15e5248d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
  1408
          notify: notify:at: primitiveFailed shouldNotImplement subclassResponsibility tryToDefineVariableAccess:)
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1409
                do: [:sel | Dangerous add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1410
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1411
"Object user interface"
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1412
        #(basicInspect beep inform: inspect inspectWithLabel: notYetImplemented inspectElement )
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1413
                do: [:sel | Dangerous add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1414
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1415
"Object system primitives"
2229
38d63b2885cc changed: #noteDangerous
Claus Gittinger <cg@exept.de>
parents: 2212
diff changeset
  1416
        #(become: becomeForward: becomeSameAs: changeClassTo: instVarAt:put: instVarNamed:put: nextInstance nextObject rootStubInImageSegment: someObject tryPrimitive:withArgs:)
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1417
                do: [:sel | Dangerous add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1418
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1419
"Object private"
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1420
        #(errorImproperStore errorNonIntegerIndex errorNotIndexable errorSubscriptBounds: mustBeBoolean primitiveError: species storeAt:inTempFrame:)
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1421
                do: [:sel | Dangerous add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1422
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1423
"Object, translation support"
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1424
        #(cCode: cCode:inSmalltalk: cCoerce:to: export: inline: returnTypeC: sharedCodeNamed:inCase: var:declareC:)
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1425
                do: [:sel | Dangerous add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1426
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1427
"Object, objects from disk, finalization.  And UndefinedObject"
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1428
        #(comeFullyUpOnReload: objectForDataStream: readDataFrom:size: rehash saveOnFile storeDataOn: actAsExecutor executor finalize retryWithGC:until:   suspend)
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1429
                do: [:sel | Dangerous add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1430
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1431
"No Restrictions:   Boolean, False, True, "
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1432
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1433
"Morph"
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1434
        #(fullCopy copyRecordingIn:)
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1435
                do: [:sel | Dangerous add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1436
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1437
"Behavior"
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1438
        #(obsolete confirmRemovalOf: copyOfMethodDictionary literalScannedAs:notifying: storeLiteral:on: addSubclass: removeSubclass: superclass: 
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1439
"creating method dictionary" addSelector:withMethod: compile: compile:notifying: compileAll compileAllFrom: compress decompile: defaultSelectorForMethod: methodDictionary: recompile:from: recompileChanges removeSelector: compressedSourceCodeAt: selectorAtMethod:setClass: allInstances allSubInstances inspectAllInstances inspectSubInstances thoroughWhichSelectorsReferTo:special:byte: "enumerating" allInstancesDo: allSubInstancesDo: allSubclassesDo: allSuperclassesDo: selectSubclasses: selectSuperclasses: subclassesDo: withAllSubclassesDo:
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1440
"user interface" allCallsOn: browse browseAllAccessesTo: browseAllCallsOn: browseAllStoresInto: "too slow->" crossReference removeUninstantiatedSubclassesSilently "too slow->" unreferencedInstanceVariables
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1441
"private" becomeCompact becomeUncompact flushCache format:variable:words:pointers: format:variable:words:pointers:weak: printSubclassesOn:level: removeSelectorSimply:)
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1442
                do: [:sel | Dangerous add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1443
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1444
"Others "
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1445
        #("no tangible result" do: associationsDo:  
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1446
"private" adaptToCollection:andSend: adaptToNumber:andSend: adaptToPoint:andSend: adaptToString:andSend: instVarAt:put: asDigitsToPower:do: combinations:atATimeDo: doWithIndex: pairsDo: permutationsDo: reverseDo: reverseWith:do: with:do: withIndexDo: asDigitsAt:in:do: combinationsAt:in:after:do: errorOutOfBounds permutationsStartingAt:do: fromUser)
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1447
                do: [:sel | Dangerous add: sel].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1448
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1449
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1450
        #(    fileOutPrototype addSpareFields makeFileOutFile )
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1451
                do: [:sel | Dangerous add: sel].
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1452
        #(recompile:from: recompileAllFrom: recompileChanges asPrototypeWithFields: asPrototype addInstanceVarNamed:withValue: addInstanceVariable addClassVarName: removeClassVarName: findOrAddClassVarName: tryToDefineVariableAccess: instanceVariableNames: )
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1453
                do: [:sel | Dangerous add: sel].
4252
6f2f15e5248d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
  1454
6f2f15e5248d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4231
diff changeset
  1455
    "Modified: / 17-07-2017 / 17:59:32 / cg"
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1456
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1457
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1458
organizationFiltered: aClass
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1459
        "Return the organization of the class with all selectors defined in superclasses removed.  (except those in Object)"
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1460
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1461
        | org str |
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1462
        org _ aClass organization deepCopy.
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1463
        Dangerous do: [:sel |
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1464
                        org removeElement: sel].
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1465
        Approved do: [:sel |
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1466
                        org removeElement: sel].
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1467
        AddAndRemove do: [:sel |
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1468
                        org removeElement: sel].
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1469
        str _ org printString copyWithout: $(.
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1470
        str _ '(', (str copyWithout: $) ).
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1471
        str _ str replaceAll: $' with: $".
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1472
        ^ str
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1473
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1474
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1475
test2: anArray
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1476
        "look for bad association"
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1477
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1478
        anArray do: [:sub |
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1479
                sub class == Association ifTrue: [
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1480
                        (#('true' '$a' '2' 'false') includes: sub value printString) ifFalse: [
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1481
                                self error: 'bad assn'].
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1482
                        (#('3' '5.6' 'x' '''abcd''') includes: sub key printString) ifFalse: [
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1483
                                self error: 'bad assn'].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1484
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1485
        "                       sub value class == Association ifTrue: [
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1486
                                        self error: 'bad assn'].
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1487
                                (sub value isKindOf: Class) ifTrue: [
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1488
                                        self error: 'class in assn'].
3444
91362ca070e5 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3403
diff changeset
  1489
                                sub value class == Symbol ifTrue: [sub value codePoint = 204 '$' ifTrue: [
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1490
                                        self error: 'Write into char']].
3444
91362ca070e5 merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3403
diff changeset
  1491
                                sub value == $ ifTrue: [
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1492
                                        self error: 'Write into char']
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1493
        "].
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1494
                sub class == Array ifTrue: [
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1495
                        sub do: [:element | 
3622
ec030e3bf4d0 class: MethodFinder
Claus Gittinger <cg@exept.de>
parents: 3515
diff changeset
  1496
                                element isString ifTrue: [element first codePoint < 32 ifTrue: [
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1497
                                                self error: 'store into string in data']].
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1498
                                element class == Association ifTrue: [
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1499
                                        element value class == Association ifTrue: [
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1500
                                                self error: 'bad assn']]]].
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1501
                sub class == Date ifTrue: [sub year isInteger ifFalse: [
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1502
                                self error: 'stored into input date!!!!']].
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1503
                sub class == Dictionary ifTrue: [
4405
cd0bc5bc3c23 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4252
diff changeset
  1504
                                sub size ~~ 0 ifTrue: [
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1505
                                        self error: 'store into dictionary']].
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1506
                sub class == OrderedCollection ifTrue: [
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1507
                                sub size > 4 ifTrue: [
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1508
                                        self error: 'store into OC']].
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1509
                ].
4405
cd0bc5bc3c23 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4252
diff changeset
  1510
cd0bc5bc3c23 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4252
diff changeset
  1511
    "Modified: / 01-03-2019 / 16:00:34 / Claus Gittinger"
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1512
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1513
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1514
test3
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1515
        "find the modification of the caracter table"
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1516
2058
c71d2ac1fbfe asciiValue obsoleted by codePoint
Claus Gittinger <cg@exept.de>
parents: 2054
diff changeset
  1517
        (#x at: 1) codePoint = 120 ifFalse: [self error: 'Character table mod'].
4503
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1518
!
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1519
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1520
warnTooManyArguments
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1521
    self warn:'No more than a receiver and 
4504
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1522
three arguments are supported'
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1523
! !
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1524
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1525
!MethodFinder methodsFor:'search'!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1526
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1527
exceptions
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1528
        "Handle some very slippery selectors.
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1529
        asSymbol -- want to be able to produce it, but do not want to make every string submitted into a Symbol!!" 
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1530
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1531
        | aSel |
3622
ec030e3bf4d0 class: MethodFinder
Claus Gittinger <cg@exept.de>
parents: 3515
diff changeset
  1532
        answers first isSymbol ifFalse: [^ self].
ec030e3bf4d0 class: MethodFinder
Claus Gittinger <cg@exept.de>
parents: 3515
diff changeset
  1533
        thisData first first isString ifFalse: [^ self].
ec030e3bf4d0 class: MethodFinder
Claus Gittinger <cg@exept.de>
parents: 3515
diff changeset
  1534
        aSel := #asSymbol.   
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1535
        (self testPerfect: aSel) ifTrue: [
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1536
                selector add: aSel.
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1537
                expressions add: (String streamContents: [:strm | 
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1538
                        strm nextPutAll: 'data', argMap first printString.
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1539
                        aSel keywords doWithIndex: [:key :ind |
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1540
                                strm nextPutAll: ' ',key.
2935
111dfc634cc2 changed:
Claus Gittinger <cg@exept.de>
parents: 2904
diff changeset
  1541
                                ((key last == $:) or:[ key first isLetter not ])
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1542
                                        ifTrue: [strm nextPutAll: ' data', 
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1543
                                                (argMap at: ind+1) printString]]])].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1544
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1545
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1546
findMessage
4504
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1547
    "Control the search."
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1548
4504
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1549
    data do: [:alist |
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1550
        (alist isSequenceable) ifFalse: [
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1551
            ^ OrderedCollection with: 'first and third items are not Arrays'
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1552
        ]
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1553
    ].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1554
4504
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1555
    true "Approved isNil" ifTrue: [self initialize].      "Sets of allowed selectors"
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1556
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1557
    expressions := OrderedCollection new.
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1558
    self search: true.      "multi"
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1559
    expressions isEmpty ifTrue: [
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1560
        ^ 'no single method found, which does that function\(but to be honest, I did not try all of them, so there may be one actually)' withCRs
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1561
    ].
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1562
    expressions isString ifTrue: [^ OrderedCollection with: expressions].
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1563
    ^ expressions
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1564
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1565
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1566
insertConstants
4463
763f8712a3c6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  1567
        "see if one of several known expressions will do it. 
763f8712a3c6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  1568
         C is the constant we discover here.
763f8712a3c6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  1569
         Needs 2 examples"
763f8712a3c6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  1570
763f8712a3c6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  1571
        "C  
763f8712a3c6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  1572
         data1+C  
763f8712a3c6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  1573
         data1*C  
763f8712a3c6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  1574
         data1//C  
763f8712a3c6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  1575
         (data1*C1 + C2) 
763f8712a3c6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  1576
         (data1 = C) 
763f8712a3c6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  1577
         (data1 ~= C) 
763f8712a3c6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  1578
         (data1 <= C) 
763f8712a3c6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  1579
         (data1 >= C) 
763f8712a3c6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  1580
         (data1 mod C)"
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1581
4504
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1582
        thisData size >= 2 ifFalse: [^ self].           "need 2 examples"
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1583
        (thisData at: 1) size == 1 ifFalse: [^ self].   "must have only one arg, data1"
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1584
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1585
        self const ifTrue: [^ self].
4463
763f8712a3c6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  1586
        "/ self constEquiv ifTrue: [^ self].       " ==  ~= "
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1587
        self constLessThan ifTrue: [^ self].    " <=  and  >= "
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1588
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1589
        self allNumbers ifFalse: [^ self].
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1590
        self constPlus ifTrue: [^ self].
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1591
        self constMult ifTrue: [^ self].
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1592
        self constDiv ifTrue: [^ self].
4504
196828a4584c #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1593
        self constMod ifTrue: [^ self].
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1594
        self constLinear ifTrue: [^ self].
4463
763f8712a3c6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  1595
763f8712a3c6 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  1596
    "Modified (comment): / 18-07-2019 / 21:27:48 / Claus Gittinger"
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1597
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1598
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1599
search: multi
4503
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1600
    "if Multi is true, collect all selectors that work."
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1601
    | old |
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1602
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1603
    selector := OrderedCollection new.       "list of them"
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1604
4503
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1605
    "  
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1606
        old _ Preferences autoAccessors.
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1607
        Preferences disableGently: #autoAccessors. 
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1608
    "
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1609
    Smalltalk isSmalltalkX ifTrue:[old := false].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1610
4503
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1611
    self simpleSearch.
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1612
    multi not & (selector isEmpty not) ifTrue: [
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1613
        "old ifTrue: [Preferences enableGently: #autoAccessors]."
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1614
        ^ selector
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1615
    ]. 
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1616
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1617
    [self permuteArgs] whileTrue:[
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1618
        self simpleSearch.
4503
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1619
        multi not & (selector isEmpty not) ifTrue:[
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1620
            "old ifTrue: [Preferences enableGently: #autoAccessors]."
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1621
            ^ selector
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1622
        ]
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1623
    ].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1624
4503
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1625
    self insertConstants.
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1626
    "  old ifTrue: [Preferences enableGently: #autoAccessors]. "
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1627
4503
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1628
    "/ (selector isEmpty not) ifTrue: [^ selector]].   " expression is the answer, not a selector"
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1629
    ^ #()
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1630
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1631
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1632
searchForOne
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1633
        "Look for and return just one answer"
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1634
4503
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1635
        expressions := OrderedCollection new.
1104
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1636
        self search: false.     "non-multi"
237db486634c copyLast: added to list
penk
parents: 1103
diff changeset
  1637
        ^ expressions
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1638
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1639
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1640
simpleSearch
4503
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1641
    "Run through first arg's class' selectors, looking for one that works."
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1642
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1643
    |class supers listOfLists numArgs|
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1644
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1645
    self exceptions.
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1646
    class := thisData first first class.
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1647
    numArgs := (argMap size) - 1.
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1648
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1649
    "Cache the selectors for the receiver class"
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1650
    (class == cachedClass and: [cachedArgNum = numArgs]) ifTrue: [
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1651
        listOfLists := cachedSelectorLists
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1652
    ] ifFalse:[
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1653
        supers := class withAllSuperclasses.
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1654
4503
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1655
        listOfLists := OrderedCollection new.
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1656
        supers do:[:cls | listOfLists add:(cls selectorsWithArgs:numArgs) ].
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1657
        cachedClass := class.
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1658
        cachedArgNum := (argMap size) - 1.
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1659
        cachedSelectorLists := listOfLists
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1660
    ].
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1661
    "/ self halt.
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1662
    listOfLists do:[:selectorList |
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1663
        selectorList do:[:aSel |
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1664
            (selector includes:aSel) ifFalse:[
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1665
                ((Approved includes:aSel) or:[AddAndRemove includes: aSel]) ifTrue: [
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1666
                    (self testPerfect:aSel) ifTrue: [
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1667
                        selector add:aSel.
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1668
                        expressions add: 
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1669
                            (String streamContents: [:strm | 
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1670
                                strm nextPutAll: 'data', argMap first printString.
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1671
                                aSel keywords doWithIndex: [:key :ind |
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1672
                                    strm nextPutAll: ' ',key.
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1673
                                    ((key last == $:) or:[ key first isLetter not]) ifTrue: [
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1674
                                        strm nextPutAll: ' data', (argMap at: ind+1) printString
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1675
                                    ]
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1676
                                ]
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1677
                            ])
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1678
                    ]
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1679
                ]
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1680
            ]
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1681
        ]
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1682
    ].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1683
!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1684
2895
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1685
testPerfect:aSelector 
4503
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1686
    "Try this selector!! 
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1687
     Return true if it answers every example perfectly.  
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1688
     Take the args in the order they are.  
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1689
     Do not permute them.
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1690
     Survive errors; later cache arg lists."
2895
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1691
    
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1692
    |sz argList val rec activeSel perform argIsBlock expectedAnswer|
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1693
4465
37feb996bde5 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4463
diff changeset
  1694
"/ (aSelector startsWith:'copy') ifTrue:[Transcript showCR:aSelector].
4466
87a487965825 #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 4465
diff changeset
  1695
"/ (aSelector = 'raisedTo:') ifTrue:[Transcript showCR:aSelector].
4465
37feb996bde5 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4463
diff changeset
  1696
2895
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1697
    "Transcript cr; show: aSelector.                debug"
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1698
    perform := aSelector beginsWith:'perform:'.
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1699
    sz := argMap size.
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1700
    1 to:thisData size do:[:ii | 
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1701
        "each example set of args"
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1702
        argList := (thisData at:ii) copyFrom:2 to:sz.
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1703
        perform ifFalse:[
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1704
            activeSel := aSelector
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1705
        ] ifTrue:[
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1706
            activeSel := argList first.
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1707
            ((Approved includes:activeSel) or:[ AddAndRemove includes:activeSel ]) ifFalse:[
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1708
                ^ false
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1709
            ].
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1710
            aSelector == #perform:withArguments: ifTrue:[
4493
ae5d6f349a13 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4466
diff changeset
  1711
                activeSel argumentCount == (argList at:2) basicSize "avoid error" ifFalse:[
2895
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1712
                    ^ false
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1713
                ]
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1714
            ] ifFalse:[
4493
ae5d6f349a13 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4466
diff changeset
  1715
                activeSel argumentCount == (aSelector argumentCount - 1) ifFalse:[
2895
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1716
                    ^ false
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1717
                ]
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1718
            ]
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1719
        ].
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1720
        1 to:sz do:[:num | 
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1721
            (Blocks includes:(Array with:activeSel with:num)) ifTrue:[
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1722
                Smalltalk isSmalltalkX ifTrue:[
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1723
                    argIsBlock := (argList at:num) isBlock
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1724
                ] ifFalse:[
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1725
                    argIsBlock := (argList at:num) class == BlockContext
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1726
                ].
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1727
                argIsBlock ifFalse:[
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1728
                    (BlocksOptional includes:(Array with:activeSel with:num)) ifFalse:[
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1729
                        ^ false
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1730
                    ]
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1731
                ]
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1732
            ]
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1733
        ].
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1734
         "   (activeSel = #capitalized) ifTrue:[self halt.].  " "  used to test  "
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1735
        rec := (AddAndRemove includes:activeSel) ifTrue:[
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1736
                (thisData at:ii) first class == Symbol ifTrue:[
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1737
                    ^ false
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1738
                ].
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1739
                 "vulnerable to modification"
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1740
                (thisData at:ii) first copyTwoLevel "protect from damage"
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1741
            ] ifFalse:[
4231
a30585392c57 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4129
diff changeset
  1742
                [(thisData at:ii) first] on:Error do:[ self halt ]
2895
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1743
            ].
4231
a30585392c57 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4129
diff changeset
  1744
        expectedAnswer := answers at:ii.
4025
3e0c6dd0ad9e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3951
diff changeset
  1745
        val := 
3e0c6dd0ad9e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3951
diff changeset
  1746
            [
3e0c6dd0ad9e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3951
diff changeset
  1747
                [
4466
87a487965825 #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 4465
diff changeset
  1748
                    "/ (selector startsWith:'copy') ifTrue:[Transcript showCR:selector].
4025
3e0c6dd0ad9e #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3951
diff changeset
  1749
                    rec copy perform:aSelector withArguments:argList
4231
a30585392c57 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4129
diff changeset
  1750
                ] on:ObsoleteMethodCallWarning do:[
a30585392c57 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4129
diff changeset
  1751
                    ^ false
a30585392c57 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4129
diff changeset
  1752
                ].    
4465
37feb996bde5 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4463
diff changeset
  1753
            ] on:HaltInterrupt do:[:ex |
37feb996bde5 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4463
diff changeset
  1754
                ex proceed
4231
a30585392c57 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4129
diff changeset
  1755
            ] on:Error do:[:ex | 
2895
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1756
                "/ Transcript showCR:aSignal description.
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1757
                "self test3."
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1758
                "self test2: (thisData at: ii)."
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1759
                ^ false
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1760
            ].
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1761
         "self test3." "self test2: (thisData at: ii)."
4231
a30585392c57 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4129
diff changeset
  1762
        (expectedAnswer isNumber) ifTrue:[
a30585392c57 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4129
diff changeset
  1763
            (expectedAnswer closeTo:val) ifFalse:[
a30585392c57 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4129
diff changeset
  1764
                ^ false
a30585392c57 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4129
diff changeset
  1765
            ]
a30585392c57 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4129
diff changeset
  1766
        ] ifFalse:[
a30585392c57 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4129
diff changeset
  1767
            (expectedAnswer isArray 
a30585392c57 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4129
diff changeset
  1768
             and:[val isNonByteCollection 
a30585392c57 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4129
diff changeset
  1769
             and:[[val asArray = expectedAnswer] on:Error do:false]]) ifTrue:[
a30585392c57 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4129
diff changeset
  1770
                ^ true
2059
9e0592033093 allow search for collection results
Claus Gittinger <cg@exept.de>
parents: 2058
diff changeset
  1771
            ].
2895
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1772
            
2061
dedc1fe14e92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2060
diff changeset
  1773
            "/ would like to remember 'almost' same, and present in separate list.
dedc1fe14e92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2060
diff changeset
  1774
"/            expectedAnswer isString ifTrue:[
dedc1fe14e92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2060
diff changeset
  1775
"/                (val isString) ifTrue:[
dedc1fe14e92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2060
diff changeset
  1776
"/                    ([val sameAs: expectedAnswer] ifError:[false]) ifTrue:[self halt. ^ true].
dedc1fe14e92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2060
diff changeset
  1777
"/                ].
dedc1fe14e92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2060
diff changeset
  1778
"/            ].
2895
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1779
            
4231
a30585392c57 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4129
diff changeset
  1780
            ([expectedAnswer = val] on:Error do:false) ifFalse:[
2895
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1781
                ^ false
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1782
            ]
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1783
        ].
2895
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1784
    ].
1d758d52e0d8 Avoid #isKindOf: where possible
Stefan Vogel <sv@exept.de>
parents: 2772
diff changeset
  1785
    ^ true
1109
d03fcfd46a99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  1786
4231
a30585392c57 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4129
diff changeset
  1787
    "Modified: / 13-11-2001 / 19:08:39 / cg"
a30585392c57 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 4129
diff changeset
  1788
    "Modified: / 18-03-2017 / 18:55:42 / stefan"
2061
dedc1fe14e92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2060
diff changeset
  1789
! !
dedc1fe14e92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2060
diff changeset
  1790
dedc1fe14e92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2060
diff changeset
  1791
!MethodFinder methodsFor:'tests'!
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1792
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1793
verify
4503
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1794
    "Test a bunch of examples"
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1795
    "       MethodFinder new verify    "
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1796
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1797
    Approved isNil ifTrue: [self initialize].      "Sets of allowed selectors"
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1798
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1799
    "/(MethodFinder new load: #( (0) 0  (30) 0.5  (45) 0.707106  (90) 1)
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1800
    "/        ) searchForOne asArray = #('data1 degreeSin') ifFalse: [self error: 'should have found it'].  "Squeak test"
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1801
    (MethodFinder new 
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1802
        load:   
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1803
            (Array 
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1804
                with:(Array with:true with:[3] with:[4]) 
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1805
                with:3 
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1806
                with:(Array with:false with:[0] with:[6]) 
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1807
                with:6
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1808
            )
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1809
    ) searchForOne asArray = #('data1 ifTrue: data2 ifFalse: data3'
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1810
    ) ifFalse: [
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1811
        self error: 'should have found it'
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1812
    ].
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1813
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1814
    (MethodFinder new 
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1815
        load: 
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1816
            #(
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1817
                #(1) true 
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1818
                #(2) false 
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1819
                #(5) true 
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1820
                #(10) false)
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1821
    ) searchForOne asArray = #('data1 odd' 'data1 isPrime'
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1822
    ) ifFalse: [self error: 'should have found it'].
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1823
        "will correct the date type of #true, and complain"
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1824
        Smalltalk isSmalltalkX ifTrue:[        
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1825
            (MethodFinder new 
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1826
                load: #(
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1827
                        (4 2) '2r100'   
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1828
                        (255 16) '16rFF'    
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1829
                        (14 8) '8r16'
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1830
                )
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1831
            ) searchForOne asArray = #('data1 radixPrintStringRadix: data2' )
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1832
            ifFalse: [
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1833
                self error: 'should have found it'
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1834
            ].        
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1835
        ] ifFalse:[
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1836
            (MethodFinder new 
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1837
                load: #(
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1838
                        (4 2) '2r100'   
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1839
                        (255 16) '16rFF'    
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1840
                        (14 8) '8r16'
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1841
                      )
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1842
            ) searchForOne asArray = 
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1843
                #(  'data1 radix: data2' 
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1844
                    'data1 printStringBase: data2' 
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1845
                    'data1 storeStringBase: data2'
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1846
                ) ifFalse: [self error: 'should have found it'].        
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1847
        ].
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1848
        "/ (MethodFinder2 new load: #(#(3@4) 4 #(1@5) 5)
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1849
        "/ ) searchForOne asArray = #('data1 y') ifFalse: [self error: 'should have found it'].    
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1850
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1851
    Smalltalk isSmalltalkX ifTrue:[
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1852
        (MethodFinder new 
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1853
            load: #(
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1854
                ('abcd') $a  
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1855
                ('TedK') $T)
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1856
        ) searchForOne asArray = #('data1 first' 'data1 removeFirst'  'data1 anyOne')   
4503
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1857
        ifFalse: [self error: 'should have found it']. 
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1858
    ] ifFalse:[
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1859
        (MethodFinder new load: #(('abcd') $a  ('TedK') $T)
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1860
            ) searchForOne asArray = #('data1 asCharacter' 'data1 first' 'data1 anyOne')
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1861
                 ifFalse: [self error: 'should have found it']. 
4503
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1862
    ].
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1863
4503
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1864
    ((
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1865
        (MethodFinder new 
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1866
            load: #(('abcd' 1) $a  ('Ted ' 3) $d )
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1867
        ) searchForOne asArray
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1868
     ) includesAll: #('data1 at: data2' 'data1 atPin: data2' 'data1 atWrap: data2')
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1869
    ) ifFalse: [ 
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1870
        self error: 'should have found it'
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1871
    ].  
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1872
    ((MethodFinder new 
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1873
        load: #(((12 4 8)) 24  ((1 3 6)) 10 )
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1874
    ) searchForOne asArray =  #('data1 sum') 
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1875
    ) ifFalse: [
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1876
        self error: 'should have found it'
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1877
    ].  
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1878
    "note extra () needed for an Array object as an argument"
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1879
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1880
    (MethodFinder new load: #((14 3) 11  (-10 5) -15  (4 -3) 7)
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1881
        ) searchForOne asArray = #('data1 - data2') ifFalse: [self error: 'should have found it'].
4503
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1882
    ((MethodFinder new load: #((4) 4  (-10) 10 (-3) 3 (2) 2 (-6) 6 (612) 612)
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1883
        ) searchForOne asArray includesAll: #('data1 abs')) ifFalse: [self error: 'should have found it'].
4503
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1884
    (MethodFinder new load: #(#(4 3) true #(-7 3) false #(5 1) true #(5 5) false)
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1885
        ) searchForOne asArray = #('data1 > data2') ifFalse: [self error: 'should have found it'].      
4503
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1886
    (MethodFinder new load: #((5) 0.2   (2) 0.5)
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1887
        ) searchForOne asArray = #('data1 reciprocal') ifFalse: [self error: 'should have found it'].   
4503
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1888
    (MethodFinder new load: #((12 4 8) 2  (1 3 6) 2  (5 2 16) 8)
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1889
        ) searchForOne asArray = #()     " '(data3 / data2) ' want to be able to leave out args"  
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1890
                ifFalse: [self error: 'should have found it'].  
4503
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1891
    (MethodFinder new load: #((0.0) 0.0  (1.5) 0.997495  (0.75) 0.681639)
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1892
        ) searchForOne asArray = #('data1 sin') ifFalse: [self error: 'should have found it'].  
4503
524210dd5d9e #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4502
diff changeset
  1893
    (MethodFinder new load: #((7 5) 2   (4 5) 4   (-9 4) 3)
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1894
        ) searchForOne asArray = #('data1 \\ data2') ifFalse: [self error: 'should have found it'].     
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1895
! !
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1896
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1897
!MethodFinder class methodsFor:'documentation'!
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1898
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1899
version
3951
bab7dcb06041 #BUGFIX
mawalch
parents: 3872
diff changeset
  1900
    ^ '$Header$'
2212
d3ee75344f82 inform: -> information:
Claus Gittinger <cg@exept.de>
parents: 2109
diff changeset
  1901
!
d3ee75344f82 inform: -> information:
Claus Gittinger <cg@exept.de>
parents: 2109
diff changeset
  1902
d3ee75344f82 inform: -> information:
Claus Gittinger <cg@exept.de>
parents: 2109
diff changeset
  1903
version_CVS
3951
bab7dcb06041 #BUGFIX
mawalch
parents: 3872
diff changeset
  1904
    ^ '$Header$'
1089
40d9ddd1f510 initial checkin
james
parents:
diff changeset
  1905
! !
3316
d11917d0dca1 class: MethodFinder
Claus Gittinger <cg@exept.de>
parents: 2935
diff changeset
  1906