[ENH] Refactoring Message - removing MessageSend

Brent Pinkney Brent at astarte.co.nz
Tue Jun 6 06:40:19 UTC 2000


Hi,

I there a Good Reason why Squeak has both Message and MessageSend as totally
separate classes ?

As far as I can tell...

MessageSend could\should be a subclass of Message as they share two instance
variables. 

Better still would be to remove MessageSend entirely - it is only referenced
in three methods in Object. (It is however refered to in
Interpeter>>#createActualMessageTo:)

Refactor MessageSend into Message keeping the instance variable order
'selector arguments lookupClass ' so that the VM doesn't whinge. 

One less class to understand - a better ratio of surface area to volume.

Attached is a changeset which removes MessageSend. It also adds comments
about the instance variable order assumed by the VM. (Ignore the warning
when filing in )

1. Evaluating '5 foo' still halts in #doesNotUnderstand:
2. (Message selector: #factorial) sentTo: 5 ==> 120
3. (Message receiver: 'abc' selector: #asUppercase) value == > 'ABC'

To do: The #setSelector:argumenst method was removed. It is still referenced
by MethodFinder>>#intialize

Thoughts ?

Brent

 <<RemoveMessageSend.4.cs>> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: RemoveMessageSend.4.cs
Type: application/octet-stream
Size: 6124 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20000606/e9526621/RemoveMessageSend.4.obj


More information about the Squeak-dev mailing list