diff -r aa2498ef6470 -r a27a279701f8 Message.st --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Message.st Fri Jul 16 11:39:45 1993 +0200 @@ -0,0 +1,94 @@ +" + COPYRIGHT (c) 1988-92 by Claus Gittinger + All Rights Reserved + + This software is furnished under a license and may be used + only in accordance with the terms of that license and with the + inclusion of the above copyright notice. This software may not + be provided or otherwise made available to, or used by, any + other person. No title to or ownership of the software is + hereby transferred. +" + +Object subclass:#Message + instanceVariableNames:'selector args' + classVariableNames:'' + poolDictionaries:'' + category:'Kernel-Methods' +! + +Message comment:' + +COPYRIGHT (c) 1988-93 by Claus Gittinger + All Rights Reserved + +these are only created, when a message fails (i.e. is not understood) - +the selector and arguments are put into an instance of Message, which is then +passed to doesNotUnderstand:aMessage as argument. + +This allows for re-evaluation of the failed send (after some cleanup). +As an example of its use, see the implementation of the Autoload-class. + +%W% %E% +'! + +!Message class methodsFor:'instance creation'! + +selector:aSymbol + "return a new message object for a send without arguments" + + ^ self basicNew selector:aSymbol + arguments:nil +! + +selector:aSymbol with:anArg + "return a new message object for a send with one argument" + + ^ self basicNew selector:aSymbol + arguments:(Array with:anArg) +! + +selector:aSymbol with:arg1 with:arg2 + "return a new message object for a send with two arguments" + + ^ self basicNew selector:aSymbol + arguments:(Array with:arg1 with:arg2) +! + +selector:aSymbol withAll:argArray + "return a new message object for a send with many arguments" + + ^ self basicNew selector:aSymbol + arguments:argArray +! ! + +!Message methodsFor:'private accessing'! + +selector:aSymbol arguments:argArray + "set selector and arguments of the receiver" + + selector := aSymbol. + args := argArray +! ! + +!Message methodsFor:'accessing'! + +selector + "return the selector of the message" + + ^ selector +! + +arguments + "return the arguments of the message" + + ^ args +! ! + +!Message methodsFor:'printing'! + +printString + "return a string for printing the receiver" + + ^ selector printString +! !