MessageSend.st
changeset 363 7745df3036a7
parent 344 4b35f99afefb
child 381 dcb27b0c7e42
--- a/MessageSend.st	Sat Jul 22 21:25:26 1995 +0200
+++ b/MessageSend.st	Sat Jul 22 23:48:28 1995 +0200
@@ -21,7 +21,7 @@
 COPYRIGHT (c) 1994 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libbasic/MessageSend.st,v 1.3 1995-05-12 12:35:09 claus Exp $
+$Header: /cvs/stx/stx/libbasic/MessageSend.st,v 1.4 1995-07-22 21:48:28 claus Exp $
 '!
 
 !MessageSend class methodsFor:'documentation'!
@@ -42,7 +42,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libbasic/MessageSend.st,v 1.3 1995-05-12 12:35:09 claus Exp $
+$Header: /cvs/stx/stx/libbasic/MessageSend.st,v 1.4 1995-07-22 21:48:28 claus Exp $
 "
 !
 
@@ -60,24 +60,30 @@
     However, the send-operation itself is faster in a block, since it
     will use a better caching scheme (inline-cache) for its send, while
     sending here is done with a #perform:, which is not inline-cached. 
-    Thus it is not sure, which one is faster in the end ...
+    Thus it is not sure, which one is actually better to use ...
+
+    You can either store arguments in the messageSend object, or
+    leave them undefined until the send is actually performed, and
+    pass any arguments with the value:-messages.
 
     If you plan to write a simulator and want to queue cillions of blocks,
-    try to use MessageSends (or even: message); this will save you a lot memory.
+    try to use MessageSends instead of blocks
+    (or even: message, if the receiver is constant);
+    this will save you a lot of memory.
 
     Example:
 
        |m|
 
        m := MessageSend receiver:1 selector:#+ arguments:#(2).
-       m value.
+       m value. 
 
        is almost the same as:
 
        |m|
 
        m := [1+2].
-       m value.
+       m value. 
 
 
     Example2 (a simulation)
@@ -142,6 +148,13 @@
      arguments"
 
     ^  receiver perform:selector with:arg1 with:arg2 with:arg3
+!
+
+valueWithArguments:argArray
+    "evaluate the messagesend, with arguments taken from argArray,
+     instead of the original arguments"
+
+    ^  receiver perform:selector withArguments:argArray
 ! !
 
 !MessageSend methodsFor:'accessing'!
@@ -156,6 +169,10 @@
     "return the receiver"
 
     ^ receiver
+!
+
+numArgs
+    ^ selector numArgs
 ! !
 
 !MessageSend methodsFor:'printing & storing'!