Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'subject:: [': 0.03; 'syntax': 0.03; 'subject:Python': 0.05; 'arguments': 0.07; 'objects,': 0.07; 'python': 0.09; 'accepts': 0.09; 'received:151': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'passing': 0.15; 'emanuele': 0.16; 'invoking': 0.16; 'modularity': 0.16; 'parameter,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:ideas': 0.16; 'syntax,': 0.16; '(in': 0.18; 'subject:] ': 0.19; 'equivalent': 0.20; 'sort': 0.21; 'implicit': 0.22; 'pascal': 0.22; 'header:User-Agent:1': 0.26; 'executing': 0.27; 'header:X-Complaints-To:1': 0.28; 'second,': 0.29; 'writes:': 0.29; 'usually': 0.30; 'function': 0.30; 'shift': 0.33; 'to:addr :python-list': 0.33; 'fail': 0.35; 'received:org': 0.36; 'fact': 0.38; 'object': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; 'called': 0.39; 'where': 0.40; 'skip:" 10': 0.40; 'subject:-': 0.40; 'header:Received:5': 0.40; 'your': 0.60; 'first': 0.61; 'director': 0.62; 'between': 0.63; 'more': 0.63; 'differences': 0.65; 'moves': 0.84; 'quando': 0.84; 'approach.': 0.91; 'erlang': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Lele Gaifax Subject: Re: [Python-ideas] Message passing syntax for objects Date: Mon, 18 Mar 2013 20:16:31 +0100 Organization: Nautilus Entertainments References: <5146B848.3040509@pearwood.info> <892700c8-4b6a-489b-96a5-8f96310bf028@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: 151.62.64.102 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:5f/cFwlpneB9Y6d7N3iH5BN0eOs= 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: 40 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1363634207 news.xs4all.nl 6865 [2001:888:2000:d::a6]:48031 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:41455 88888 Dihedral writes: > zipher於 2013年3月19日星期二UTC+8上午1時04分36秒寫道: >> 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. > > Please check object pascal and objective c and erlang for > the message-action director model of what you want. I fail to see how syntax differences would change the modularity of your product. The fact that (say) ObjC use the name "message" while Python calls the same a "method" isn't actually changing the concrete fact that both are executing some sort of function that accepts an "instance" object as one of the arguments (in Python, the first parameter, usually called self, in ObjC, and implicit "self"). In other words, the following ObjC [someObj getItemAt: i] is perfectly equivalent to the following Python someObj.getItemAt(i) and to the following Smalltalk someObj getItemAt: i How is the former syntax, where "getItemAt:" is called a "message", more modular from the second, where "getItemAt()" is called a method? ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. lele@metapensiero.it | -- Fortunato Depero, 1929.