[Python-ideas] Message passing syntax for objects

Shane Green shane at umbrellacode.com
Mon Mar 18 09:51:38 CET 2013

So, by introducing this collaboration mechanism with a syntax that defines it as sending and receiving things that are *not* arbitrary objects, the language would naturally reinforce a more thoroughly decoupled architecture?  

Sent from my iPad

On Mar 17, 2013, at 8:53 PM, Mark Janssen <dreamingforward at gmail.com> wrote:

> Hello,
> I just posted an answers on quora.com about OOP (http://qr.ae/TM1Vb)
> and wanted to engage the python community on the subject.
> Alan Kay's idea of message-passing in Smalltalk are interesting, and
> like the questioner says, never took off.  My answer was that Alan
> Kay's abstraction of "Everything is an object" fails because you can't
> have message-passing, an I/O task, working in the same space as your
> objects -- they are two very different functionalities and they have
> to be preserved **for the programmer**.
> This functional separation made me think that Python could benefit
> from a syntactical, language-given separation between Classes and the
> messages between them, to encourage loosely-coupled, modular OOP.
> Something that OOP has always promised but never delivered.
> I think we should co-opt C++'s poorly used >> and << I/O operators
> (for files) and re-purpose them for objects/classes.  One could then
> have within interpreter space, the ability to pass in a message to an
> object.
>>>> 42 >> MyObject  #sends 42 as a message into MyObject
> The Object definition would then have special methods __in__ to
> receive data and a special way of outputing data that can be caught
> __str__(?).
> I'm hoping the community can comment on the matter....
> Thanks,
> Mark
> Tacoma, Washington
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas

More information about the Python-ideas mailing list