ALU capability (was Re: [E-Lang] Authority -- what is its dual?)
Dean Tribble
tribble@e-dean.com
Fri, 19 Oct 2001 01:40:40 -0700
At 12:14 AM 10/19/2001, Peter Van Roy wrote:
> > At 09:40 AM 10/18/01 -0400, Jonathan A Rees wrote:
> >
> > >...
> > >cons cells) are un-invokable. Part of what's meant by the oo mantra
> > > "everything is an object" is that everything is invokable, and
> (ideally)
> > > that the semantics of anything is only the semantics of invoking
> it. A
> > > thing has no properties other than the behavior elicited by
> > > invocation. (To
> > > my knowledge, only some Actors language and Joule achieve this ideal.
> > > Smalltalk and E do not.)
> >
> > Just for clarification, Smalltalk does take the "everything is an object"
> > perspective, even if it does not completely follow through on it.
>
>As I remember it, Smalltalk has lexically-scoped closures, "blocks", which
>are used to define control abstractions. Blocks are not objects, which is
>exactly as it should be, IMHO.
Smalltalk Blocks are Objects. They respond to the 'value' message by
computing their value. they respond to other messages, and Smalltalk
programmers can extend their behavior (which is how exception handling was
implemented, for instance).
> The problem with the 'everything is an
>object' philosophy is that there are two approaches lurking:
>
>1. Everything has uniform object syntax --> bad idea! It just pushes the
> language's richness into the class & object names, an extra layer of
> syntax that is cumbersome.
The choice of syntax has almost nothing to do with whether "everything is
an object". Bad syntax is bad syntax, and is a different level of issue, I
think.
>2. Everything is an abstract data type (well-defined set of values +
>operations)
> --> much better.
>
>As I understand Smalltalk, it follows (2) which is the right way to go, as
>far as I can tell.
I'm not actually sure what you mean by option 2.
>(Another issue is whether all ADTs should be potentially definable with
>inheritance. That's another can of worms!)
Inheritance is mostly independent of object-ness--it isprimarily a
code-sharing hack :-)