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