OO model

Francois-Rene Rideau rideau@ens.fr
Wed, 22 May 1996 16:08:17 +0200 (MET DST)

[Follow up to Jecel's comment on my letter to rms]

>> so that "sending a message"
>> (I hate that OO terminology
>> -- can't people just say "applying a function" ?)
> Sorry, but I had to comment on this: sending a message in
> an OO system is *not* the same as "applying a function"!
Well, essentially, sending message M to object O
*is* isomorphic to applying generic function M to O.
The scheme-based object model show it fairly well, I think.
   The particularity of typical "OO" messages is the fact
that the function behavior is dispatched according to some local information.
But that's independent quite independent from the messaging model.
   Then problem I see is that people are generally mixing up
many things when using the traditional OO model:
* the context in which dispatching is done
* the objects to which the function is applied
* the way the function returns a result (traditional OO is completely
 impure and side effective)
   Hence, the traditional OO messaging model is flawed, because it can't
account for functions dispatched according to multiple arguments
and for pure programming style (who's receiving the message ?).
I've seen people talking about message sent without addressee,
but I find that ridiculous.
   To me, "OO" should be cleaned up by well-separating the three things above:
dispatching context, evaluation parameters, and location for the result.
Of course, the three things are not independent;
they are just not "the same"; they do need not even have the same type !!!

> It might become the same if you restrict the semantics of
> the system (C++, for example) or as the result of partial
> evatualtion of the typical case.
I'd rather say that the restriction is in systems
that can't express the difference between a value and a variable.
ML does it right, C++ does it completely wrong;
Scheme allows you to do exactly what you want,
but doesn't allow a program to express what it does in its interface.

> But just because a
> partial evaluation/inlining of "a+b" is "a" for the case
> where b=0 doesn't justify saying "a+b is a".
It does if you implement numbers as pure objects, as in Scheme,
which is the semantically simplest and cleanest way to do things,
instead of implementing them as number variables,
which only gets in the way of most programmers,
while it would be easily expressible as an object
from the pure paradigm with explicit dereferencing.
OCAML, IMNHO, shows that the clean way to do OO programming is
specifically NOT to mix-up values and variables.

> I hope Stallman answers you.
I didn't expect him to do, though I am glad he did.
After the idea occured to me that perhaps he or someone he would contact
might be interested in Tunes, I prefered to send him a note,
so that I wouldn't have to think about it anymore later. After all,
if anyone can give hints about launching big free software projects,
that's him, isn't it ?

--    ,                                         ,           _ v    ~  ^  --
-- Fare -- rideau@clipper.ens.fr -- Francois-Rene Rideau -- +)ang-Vu Ban --
--                                      '                   / .          --
Join the TUNES project for a computing system based on computing freedom !
                 TUNES is a Useful, Not Expedient System
WWW page at URL: "http://www.eleves.ens.fr:8080/home/rideau/Tunes/"