Python Macros
Josiah Carlson
jcarlson at uci.edu
Mon Oct 4 15:19:16 EDT 2004
> Not sure I understand you here. I want to implement messages like in
> ObjC where if you send a msg to an object and that object does know what
> to do with it, it can send the obj automatically to another object which
> might know what to do with it.
>
> Anyhow, there are other reasons as well.
What are called "messages" in ObjC, are generally known as "instance
methods" in Python.
I would imagine in ObjC you would do something like the following:
object.send('operation', arg1, arg2, arg3,...)
send(object, 'operation', arg1, arg2, arg3,...)
In Python, that becomes:
object.operation(arg1, arg2, arg3,...)
"Messages" in ObjC are really just a metaphor, one that is shared by
Smalltalk, but not many other object-oriented languages.
- Josiah
More information about the Python-list
mailing list