author | Claus Gittinger <cg@exept.de> |
Fri, 28 Jun 2019 08:49:56 +0200 | |
changeset 24385 | dd84e4dfb5cc |
parent 22311 | 5331770c9388 |
permissions | -rw-r--r-- |
21918 | 1 |
"{ Encoding: utf8 }" |
2 |
||
2247 | 3 |
" |
4 |
COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger |
|
5 |
All Rights Reserved |
|
6 |
||
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
5351
f9529bd6b6e4
oops - must setup the isBLOCK / isBLOCKLIKE flags correctly
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
14 |
"{ Package: 'stx:libbasic' }" |
f9529bd6b6e4
oops - must setup the isBLOCK / isBLOCKLIKE flags correctly
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
15 |
|
21918 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
5351
f9529bd6b6e4
oops - must setup the isBLOCK / isBLOCKLIKE flags correctly
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
18 |
CheapBlock variableSubclass:#VarArgCheapBlock |
2247 | 19 |
instanceVariableNames:'' |
20 |
classVariableNames:'' |
|
21 |
poolDictionaries:'' |
|
22 |
category:'Kernel-Methods' |
|
23 |
! |
|
24 |
||
25 |
!VarArgCheapBlock class methodsFor:'documentation'! |
|
26 |
||
27 |
copyright |
|
28 |
" |
|
29 |
COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger |
|
30 |
All Rights Reserved |
|
31 |
||
32 |
This software is furnished under a license and may be used |
|
33 |
only in accordance with the terms of that license and with the |
|
34 |
inclusion of the above copyright notice. This software may not |
|
35 |
be provided or otherwise made available to, or used by, any |
|
36 |
other person. No title to or ownership of the software is |
|
37 |
hereby transferred. |
|
38 |
" |
|
39 |
||
40 |
||
41 |
! |
|
42 |
||
43 |
documentation |
|
44 |
" |
|
21918 | 45 |
read the documentation in VarArgBlock. |
2247 | 46 |
|
47 |
[author:] |
|
22311 | 48 |
Claus Gittinger |
2247 | 49 |
|
50 |
[see also:] |
|
22311 | 51 |
VarArgBlock Block CheapBlock |
2247 | 52 |
" |
53 |
! ! |
|
54 |
||
5351
f9529bd6b6e4
oops - must setup the isBLOCK / isBLOCKLIKE flags correctly
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
55 |
!VarArgCheapBlock class methodsFor:'initialization'! |
f9529bd6b6e4
oops - must setup the isBLOCK / isBLOCKLIKE flags correctly
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
56 |
|
f9529bd6b6e4
oops - must setup the isBLOCK / isBLOCKLIKE flags correctly
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
57 |
initialize |
f9529bd6b6e4
oops - must setup the isBLOCK / isBLOCKLIKE flags correctly
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
58 |
"must clear the is-block flag bit in the class |
f9529bd6b6e4
oops - must setup the isBLOCK / isBLOCKLIKE flags correctly
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
59 |
(otherwise, the VM might try to inline value-messages)" |
f9529bd6b6e4
oops - must setup the isBLOCK / isBLOCKLIKE flags correctly
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
60 |
|
15092 | 61 |
|newFlags| |
5353 | 62 |
|
22311 | 63 |
newFlags := (self flags |
64 |
bitClear:(Behavior flagBlock)) |
|
65 |
bitOr:(Behavior flagVarArgBlock). |
|
15092 | 66 |
self flags:newFlags. |
5351
f9529bd6b6e4
oops - must setup the isBLOCK / isBLOCKLIKE flags correctly
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
67 |
|
f9529bd6b6e4
oops - must setup the isBLOCK / isBLOCKLIKE flags correctly
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
68 |
" |
22311 | 69 |
self flags. |
5351
f9529bd6b6e4
oops - must setup the isBLOCK / isBLOCKLIKE flags correctly
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
70 |
self initialize. |
22311 | 71 |
self flags. |
5351
f9529bd6b6e4
oops - must setup the isBLOCK / isBLOCKLIKE flags correctly
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
72 |
" |
f9529bd6b6e4
oops - must setup the isBLOCK / isBLOCKLIKE flags correctly
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
73 |
! ! |
f9529bd6b6e4
oops - must setup the isBLOCK / isBLOCKLIKE flags correctly
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
74 |
|
2247 | 75 |
!VarArgCheapBlock methodsFor:'evaluation'! |
76 |
||
77 |
value |
|
78 |
"evaluate the receiver with no block args." |
|
79 |
||
80 |
^ super value:#() |
|
81 |
||
82 |
"Created: 23.1.1997 / 04:57:49 / cg" |
|
83 |
! |
|
84 |
||
85 |
value:arg |
|
86 |
"evaluate the receiver with a single argument." |
|
87 |
||
88 |
^ super value:(Array with:arg) |
|
89 |
||
90 |
"Created: 23.1.1997 / 04:57:57 / cg" |
|
91 |
! |
|
92 |
||
93 |
value:arg1 value:arg2 |
|
94 |
"evaluate the receiver with two arguments." |
|
95 |
||
96 |
^ super value:(Array with:arg1 with:arg2) |
|
97 |
||
98 |
"Created: 23.1.1997 / 04:58:03 / cg" |
|
99 |
! |
|
100 |
||
101 |
value:arg1 value:arg2 value:arg3 |
|
102 |
"evaluate the receiver with three arguments." |
|
103 |
||
104 |
^ super value:(Array with:arg1 with:arg2 with:arg3) |
|
105 |
||
106 |
"Created: 23.1.1997 / 04:58:09 / cg" |
|
107 |
! |
|
108 |
||
109 |
value:arg1 value:arg2 value:arg3 value:arg4 |
|
110 |
"evaluate the receiver with four arguments." |
|
111 |
||
22311 | 112 |
^ super value:(Array |
113 |
with:arg1 |
|
114 |
with:arg2 |
|
115 |
with:arg3 |
|
2247 | 116 |
with:arg4) |
117 |
||
118 |
"Modified: 22.1.1997 / 19:41:22 / cg" |
|
119 |
"Created: 23.1.1997 / 04:58:14 / cg" |
|
120 |
! |
|
121 |
||
122 |
value:arg1 value:arg2 value:arg3 value:arg4 value:arg5 |
|
123 |
"evaluate the receiver with five arguments." |
|
124 |
||
22311 | 125 |
^ super value:(Array |
126 |
with:arg1 |
|
127 |
with:arg2 |
|
128 |
with:arg3 |
|
2247 | 129 |
with:arg4 |
130 |
with:arg5) |
|
131 |
||
132 |
"Modified: 22.1.1997 / 19:41:26 / cg" |
|
133 |
"Created: 23.1.1997 / 04:58:18 / cg" |
|
134 |
! |
|
135 |
||
136 |
value:arg1 value:arg2 value:arg3 value:arg4 value:arg5 value:arg6 |
|
137 |
"evaluate the receiver with six arguments." |
|
138 |
||
22311 | 139 |
^ super value:(Array |
140 |
with:arg1 |
|
141 |
with:arg2 |
|
142 |
with:arg3 |
|
2247 | 143 |
with:arg4 |
144 |
with:arg5 |
|
145 |
with:arg6) |
|
146 |
||
147 |
"Modified: 22.1.1997 / 19:41:29 / cg" |
|
148 |
"Created: 23.1.1997 / 04:58:22 / cg" |
|
149 |
! |
|
150 |
||
151 |
value:arg1 value:arg2 value:arg3 value:arg4 value:arg5 value:arg6 value:arg7 |
|
152 |
"evaluate the receiver with seven arguments." |
|
153 |
||
22311 | 154 |
^ super value:(Array |
155 |
with:arg1 |
|
156 |
with:arg2 |
|
157 |
with:arg3 |
|
2247 | 158 |
with:arg4 |
159 |
with:arg5 |
|
160 |
with:arg6 |
|
161 |
with:arg7) |
|
162 |
||
163 |
"Modified: 22.1.1997 / 19:41:33 / cg" |
|
164 |
"Created: 23.1.1997 / 04:58:26 / cg" |
|
165 |
! |
|
166 |
||
167 |
value:arg1 value:arg2 value:arg3 value:arg4 value:arg5 value:arg6 value:arg7 value:arg8 |
|
168 |
"evaluate the receiver with eight arguments." |
|
169 |
||
22311 | 170 |
^ super value:(Array |
171 |
with:arg1 |
|
172 |
with:arg2 |
|
173 |
with:arg3 |
|
2247 | 174 |
with:arg4 |
175 |
with:arg5 |
|
176 |
with:arg6 |
|
177 |
with:arg7 |
|
178 |
with:arg8) |
|
179 |
||
180 |
"Created: 23.1.1997 / 04:58:30 / cg" |
|
181 |
! |
|
182 |
||
183 |
valueWithArguments:argArray |
|
184 |
"evaluate the receiver with all arguments in argArray." |
|
185 |
||
186 |
^ super value:argArray |
|
187 |
||
188 |
"Created: 23.1.1997 / 04:59:16 / cg" |
|
189 |
! ! |
|
190 |
||
191 |
!VarArgCheapBlock methodsFor:'testing'! |
|
192 |
||
193 |
isVarArgBlock |
|
194 |
"return true, if this block accepts a variable number of arguments" |
|
195 |
||
196 |
^ true |
|
197 |
||
198 |
"Created: 23.1.1997 / 05:00:18 / cg" |
|
199 |
! ! |
|
200 |
||
201 |
!VarArgCheapBlock class methodsFor:'documentation'! |
|
202 |
||
203 |
version |
|
21918 | 204 |
^ '$Header$' |
2247 | 205 |
! ! |
7589 | 206 |
|
15092 | 207 |
|
5351
f9529bd6b6e4
oops - must setup the isBLOCK / isBLOCKLIKE flags correctly
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
208 |
VarArgCheapBlock initialize! |