[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


> Date: Mon, 16 Jun 2003 16:15:30 -0700 (PDT)
> From: Avi Bryant <avi@beta4.com>
> On Mon, 16 Jun 2003, Michael Vanier wrote:
> > It's pretty trivial to implement ST-style OO in lisp; how easy is it to
> > implement lisp in ST?
> *Is* it that trivial?  From a syntax point of view (and that's what we're
> talking about, right?), the most crucial things about smalltalk IMO are:
> - super lightweight lambdas (the minimal thunk, [], is two characters)
> - keyword selectors (*not* keyword arguments)
> - message dispatch as the basic operation (no need to use a send
> function or some such)

Actually, I was thinking of a semantic equivalent for ST
e.g. single-dispatch OO.  I agree that supporting the syntax is much
trickier.  Interestingly, PLT scheme has a single-dispatch OO system (which
also supports mixins) which uses a "send" special form.  It seems pretty
heavyweight to me, but I haven't used it much.

Keyword selectors are nice, but I can't help feeling that

    [block evaluating to a boolean] 
        IfTrue: [true block] 
        IfFalse: [false block].

is counterintuitive versus a more conventional

    If: [block evaluating to a boolean]
    Then: [true block]
    Else: [false block].

and I think this sort of thing has hurt smalltalk's acceptance.  Of course,
you could pull a ruby-like trick and postulate that all keyword selectors
without explicit targets are sent to "the environment".