Returning messages in Smalltalk
- by Zachary
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.