Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.119 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.76; '*S*': 0.00; 'interpreter': 0.04; 'python': 0.09; 'abstraction': 0.09; 'alan': 0.09; 'sfxlen:2': 0.10; 'files)': 0.16; 'preserved': 0.16; 'to:name:python list': 0.16; 'thanks,': 0.18; '>>>': 0.18; 'object.': 0.22; 'posted': 0.22; 'to:2**1': 0.23; 'idea': 0.24; 'pass': 0.25; 'message- id:@mail.gmail.com': 0.27; 'i/o': 0.29; 'oop': 0.29; 'to:name :python-ideas': 0.29; 'definition': 0.29; 'objects': 0.29; "i'm": 0.29; 'classes': 0.30; 'space,': 0.32; 'could': 0.32; 'to:addr :python-list': 0.33; "can't": 0.34; 'received:google.com': 0.34; 'community': 0.35; 'something': 0.35; 'ability': 0.36; 'but': 0.36; 'wanted': 0.36; 'functional': 0.36; 'should': 0.36; 'two': 0.37; '(for': 0.37; 'data': 0.37; 'mark': 0.38; 'comment': 0.38; 'object': 0.38; 'to:addr:python.org': 0.39; 'space': 0.39; 'hello,': 0.39; 'think': 0.40; 'your': 0.60; 'between': 0.63; 'different': 0.63; 'within': 0.64; 'engage': 0.65; 'subject.': 0.65; 'to:addr:python-ideas': 0.69; 'benefit': 0.70; 'receive': 0.71; 'hoping': 0.72; 'special': 0.73; 'interesting,': 0.84; 'promised': 0.91; 'task,': 0.91; 'poorly': 0.93; 'washington': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=JT3/xf1fO0jjyKug51ogRp82IPHT2U0G+ppXLPBJGkk=; b=dh/DWVX/9Pm8tqBCrNq5LQ4197/92xJv0ZNBnDCT4kA1CxvYNkEO7yzqI9TxSzgjcs we/8fMGfmYiDnV79mxp5oB9xbCp6YTcmqXT+M/PB4AglvcjK73V0mHM61HNPORnCEwN/ 93y++tLgUR5Vf0V8yGii6z5ETdoQNzJx38WGfSmsCslyGOYw1l1gZrWVmGCXqsTQVHgK Ox7IqFaRw8uE3pgEm62vaA7wjelqFyv7pagKWZ5xJNUpRO0JelXtny/30V+v1vLpdhxi 6cB9L8qJWJAdX57mN3PqbfxxsK6MBMr09t1MyCz/t0XI5cM/mFH4qTMczgS4ZRxTusnv axEw== MIME-Version: 1.0 X-Received: by 10.180.75.177 with SMTP id d17mr14115864wiw.16.1363578797178; Sun, 17 Mar 2013 20:53:17 -0700 (PDT) Date: Sun, 17 Mar 2013 20:53:17 -0700 Subject: Message passing syntax for objects From: Mark Janssen To: Python List , Python-Ideas Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 34 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1363578805 news.xs4all.nl 6906 [2001:888:2000:d::a6]:40481 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:41390 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