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