MessageSend.st
changeset 17696 bdccf4ca66ba
parent 16535 7e7955b07b1f
child 18120 e3a375d5f6a8
child 21531 3741418705e1
equal deleted inserted replaced
17695:2f478cffbfab 17696:bdccf4ca66ba
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 1994 by Claus Gittinger
     4  COPYRIGHT (c) 1994 by Claus Gittinger
     3 	      All Rights Reserved
     5 	      All Rights Reserved
     4 
     6 
     5  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
     9  other person.  No title to or ownership of the software is
    11  other person.  No title to or ownership of the software is
    10  hereby transferred.
    12  hereby transferred.
    11 "
    13 "
    12 "{ Package: 'stx:libbasic' }"
    14 "{ Package: 'stx:libbasic' }"
    13 
    15 
       
    16 "{ NameSpace: Smalltalk }"
       
    17 
    14 Message subclass:#MessageSend
    18 Message subclass:#MessageSend
    15 	instanceVariableNames:'receiver'
    19 	instanceVariableNames:'receiver'
    16 	classVariableNames:''
    20 	classVariableNames:''
    17 	poolDictionaries:''
    21 	poolDictionaries:''
    18 	category:'Kernel-Methods'
    22 	category:'Kernel-Methods'
   160     "Modified: 20.3.1997 / 21:55:44 / cg"
   164     "Modified: 20.3.1997 / 21:55:44 / cg"
   161 ! !
   165 ! !
   162 
   166 
   163 !MessageSend methodsFor:'Compatibility-Squeak'!
   167 !MessageSend methodsFor:'Compatibility-Squeak'!
   164 
   168 
   165 cull: firstArg 
   169 cull: optionalFirstArg 
   166     "activate the receiver with one or zero arguments"
   170     "activate the receiver with one or zero arguments.
   167 
   171      Squeak compatibility, but also present in VW Smalltalk"
   168     selector numArgs >= 1 ifTrue:[^ self value:firstArg].
   172 
       
   173     selector numArgs >= 1 ifTrue:[^ self value:optionalFirstArg].
   169     ^ self value
   174     ^ self value
   170 
   175 
   171     "Modified: / 03-06-2014 / 12:40:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   176     "Modified: / 03-06-2014 / 12:40:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   172 !
   177 !
   173 
   178 
   174 cull: firstArg cull: secondArg
   179 cull: optionalFirstArg cull: optionalSecondArg
   175     "activate the receiver with two or less arguments"
   180     "activate the receiver with two or less arguments.
       
   181      Squeak compatibility, but also present in VW Smalltalk"
   176 
   182 
   177     | nargs |
   183     | nargs |
   178 
   184 
   179     nargs := selector numArgs.
   185     nargs := selector numArgs.
   180     nargs >= 2 ifTrue:[^ self value:firstArg value:secondArg].
   186     nargs >= 2 ifTrue:[^ self value:optionalFirstArg value:optionalSecondArg].
   181     nargs = 1 ifTrue:[^ self value:firstArg].
   187     nargs = 1 ifTrue:[^ self value:optionalFirstArg].
   182     ^ self value
   188     ^ self value
   183 
   189 
   184     "Modified (format): / 03-06-2014 / 12:40:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   190     "Modified (format): / 03-06-2014 / 12:40:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   185 !
   191 !
   186 
   192 
   187 cull: firstArg cull: secondArg cull: thirdArg
   193 cull: firstArg cull: optionalSecondArg cull: optionalThirdArg
   188     "activate the receiver with three or less arguments"
   194     "activate the receiver with three or less arguments.
       
   195      Squeak compatibility, but also present in VW Smalltalk"
   189 
   196 
   190     | nargs |
   197     | nargs |
   191 
   198 
   192     nargs := selector numArgs.
   199     nargs := selector numArgs.
   193     nargs >= 2 ifTrue:[
   200     nargs >= 2 ifTrue:[
   194         nargs >= 3 ifTrue:[
   201         nargs >= 3 ifTrue:[
   195             ^ self value:firstArg value:secondArg value:thirdArg
   202             ^ self value:firstArg value:optionalSecondArg value:optionalThirdArg
   196         ].
   203         ].
   197         ^ self value:firstArg value:secondArg
   204         ^ self value:firstArg value:optionalSecondArg
   198     ].
   205     ].
   199     nargs = 1 ifTrue:[^ self value:firstArg].
   206     nargs = 1 ifTrue:[^ self value:firstArg].
   200     ^ self value
   207     ^ self value
   201 
   208 
   202     "Modified: / 03-06-2014 / 12:40:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   209     "Modified: / 03-06-2014 / 12:40:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   346 ! !
   353 ! !
   347 
   354 
   348 !MessageSend class methodsFor:'documentation'!
   355 !MessageSend class methodsFor:'documentation'!
   349 
   356 
   350 version
   357 version
   351     ^ '$Header: /cvs/stx/stx/libbasic/MessageSend.st,v 1.25 2014-06-03 11:41:54 vrany Exp $'
   358     ^ '$Header: /cvs/stx/stx/libbasic/MessageSend.st,v 1.26 2015-03-27 11:21:29 cg Exp $'
   352 !
   359 !
   353 
   360 
   354 version_CVS
   361 version_CVS
   355     ^ '$Header: /cvs/stx/stx/libbasic/MessageSend.st,v 1.25 2014-06-03 11:41:54 vrany Exp $'
   362     ^ '$Header: /cvs/stx/stx/libbasic/MessageSend.st,v 1.26 2015-03-27 11:21:29 cg Exp $'
   356 ! !
   363 ! !
   357 
   364