Returning messages in Smalltalk
Posted
by Zachary
on Stack Overflow
See other posts from Stack Overflow
or by Zachary
Published on 2010-03-08T06:33:19Z
Indexed on
2010/03/08
6:36 UTC
Read the original article
Hit count: 242
smalltalk
I have a Dictionary of objects I have created in smalltalk, which I am iterating over by enumerating it based on the key/value pairs.
For value object in the dictionary, I am calling a method on that object. Based on certain conditions, I would like for this object to be able to add a new member to dictionary, and possibly delete another one.
I've been looking at the 'Perform' and 'Messages' facilities in Smalltalk, but I'm not sure if it is even possible to do what I'm trying to do - is it possible to return a message (or multiple messages), which another object can process and perform?
For example, could my method return 'removeKey: 19' and 'add object' at the same time?
I am using GNU Smalltalk, if it matters.
© Stack Overflow or respective owner