[Python-ideas] Message passing syntax for objects
Mark Janssen
dreamingforward at gmail.com
Mon Mar 18 18:04:36 CET 2013
On Sun, Mar 17, 2013 at 11:46 PM, Steven D'Aprano <steve at pearwood.info> wrote:
> I am very interested in this as a concept, although I must admit I'm not
> entirely sure what you mean by it. I've read your comment on the link above,
> and subsequent emails in this thread, and I'm afraid I don't understand what
> you mean here. I feel you are assuming that your readers are already experts
> on message-passing languages (Smalltalk?). I know what *I* mean by message
> passing, but that's not necessarily what you mean by it.
I'm sorry, I haven't been very clear. I'm not even an expert on
message-passing languages, but I see that it's a profound concept that
hasn't been adequately integrated into the OOP model. In any case, I
will try to do better. And I apologize to everyone on the list for
the prior mail spam. A part of me is a bit giddy with the idea.
By message passing, I mean all the ways we communicate to objects in
the OOP environment. Usually we "communicate" to them through
method-invokation. But this is the wrong way, I argue, to look at the
problem.
With function or method syntax, you're telling the computer to
"execute something", but that is not the right concepts for OOP. You
want the objects to interact with each other and in a high-level
language, the syntax should assist with that.
> By building it into the language, it would *enforce* a modular object
> style, rather than the current, very specialized and very programmer
> specific way there is now. In fact, most people never really think in
> that paradigm, yet if the language supported/proposed such a syntax,
> programmers would start to re-arrange the whole object hierarchy in a
> new, more modular and universal way.
> [end quote]
>
> I don't understand this. In what way would message passing enforce a modular
> object style? In what way does Python not already have a modular object
> style?
Hopefully my paragraph clarifies that a bit. But the key conceptual
shift is that by enforcing a syntax that moves away from invoking
methods and move to message passing between objects, you're
automatically enforcing a more modular approach.
Mark
More information about the Python-ideas
mailing list