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