Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #41458

Re: [Python-ideas] Message passing syntax for objects

References <CAMjeLr_dBCSL9VGjrW6wJjMDhLWFdxWqGWw+5MXTfo8+x9yfYw@mail.gmail.com> <CAMjeLr_q-8NbBAOOZ7yu8H+WcrJNU=8ZmudWkt9itM9ZLJuh4g@mail.gmail.com> <ki7oja$u70$1@ger.gmane.org> <CAMjeLr9MRs4aozfYwHU93nKZ0_8s5guFrtj+m_AMycgvFch2Mg@mail.gmail.com>
Date 2013-03-18 13:34 -0700
Subject Re: [Python-ideas] Message passing syntax for objects
From Benjamin Kaplan <benjamin.kaplan@case.edu>
Newsgroups comp.lang.python
Message-ID <mailman.3475.1363638846.2939.python-list@python.org> (permalink)

Show all headers | View raw


On Mon, Mar 18, 2013 at 1:24 PM, Mark Janssen <dreamingforward@gmail.com> wrote:
> On Mon, Mar 18, 2013 at 12:06 PM, Georg Brandl <g.brandl@gmx.net> wrote:
>> Am 18.03.2013 05:26, schrieb Mark Janssen:
>>> Continuing on this thread, there would be a new bunch of behaviors to
>>> be defined.  Since "everything is an object", there can now be a
>>> standard way to define the *next* common abstraction of "every object
>>> interacts with other objects".
>>
>> The problem is that for most objects there isn't *the* interaction.  Sure,
>> you could split up complicated objects into small pieces with a smaller
>> functionality, but at some point you have to stop.
>
> Yes.  But that is the point, if you look at the quora post -- to
> invert the object model and create mashups of simple modular data
> types and working *upwards*.
>
>>  Let's see how this
>> concept fares with simple types such as integers or collections...
>>
>>>>>> 42 >> MyNumberType #would add the integer to your integer type
>>
>> That's just random.  Why not multiply?  Why not exponentiate?
>
> Well, as I noted in another post, that while these can be broken down
> into their simpler component (addition and negative numbers), numbers
> should probably be treated separately.
>
>>>>>> 42 >> MyCollectionType  #would add the object into your collection:
>>>  *poof*: no more random syntaxiis for putting things in collections.\
>>
>> So you've replaced one method of a collections API by your magical operator,
>> for all collections.
>
> Yes -- for all collections.  That's a pretty big gain right?
>

Nope. No gain at all. Instead of learning the add() method, you learn
the >> operator. You have not simplified anything.
>> It seems that you are reinventing pipes (such as UNIX shell pipes).
>
> That is a very interesting comparison.  That is something like what
> I'm trying to do.  In tandem with the Internet, I do see a kind of
> synthesis of Web + O.S. integration -- ultimately, creating a "data
> ecosystem".
>
> mark

Yes, having the whole program run by chaining functions together is a
neat idea. And it works great in functional languages- if you want
that as a feature, use OCaml or Haskell. It works less well in
imperative languages where you are manipulating data, not just passing
it around.

> --
> http://mail.python.org/mailman/listinfo/python-list

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: [Python-ideas] Message passing syntax for objects Benjamin Kaplan <benjamin.kaplan@case.edu> - 2013-03-18 13:34 -0700

csiph-web