[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: blocks
On Fri, 6 Oct 1995 20:20:16 -0700
David.Ungar@Eng.Sun.COM (David Ungar) wrote:
> The eval message story may possible confuse meta-levels,
> after all, how would you run eval (send eval?)?
It was probably a bad idea. I was trying to expand on the
story that when you "run an object", it might simply return
itself or it might clone itself and execute code. It is
probably as explicit as it should be already without me
adding inheritance to it!
> This is interesting, Jecel, the story seems to rely on
> local methods (methods in local slots) running
> w/ lexical scoping. It may be in the right direction--not sure.
I am far from sure myself. My idea was that Self once had "inner methods"
and so this direction wouldn't be too far off.
> Another possibility, suggested to me by someone (I cannot remember
> right now), is to change the rule that the slot initializer
> runs in the context of the lobby, so that instead it
> runs in the current lexical context.
>
> In this story, the block is created as an object, not a method
> in the local slot:
>
> ( |
> test = ( |
> i <- 0.
> b1 = ( | p* = traits block. value = ( i * i ). p2* = thisActivation | ).
> b1 value "returns i squared".
> | )
> | ) test
>
> not quite right, but close
If you have lexical context slot initialization ( which would make some
things much easier ) you could not say "p* = traits block". And without
this, a lot of important things could no longer be done in text-only
Self ( they could still be built interactively in the GUI, though ).
Like you said, this is the general idea and not a "working implementation".
A missing detail is that "<self> b1" would have to return a clone, and
not the object itself. This would make the "p* = thisActivation" wrong.
Another thing is that "b1" acts both as a block *and* as the receiver
of the message in which is appears ( it understands the "i" message,
for example ). If this is acceptable ( and I think it might be, even
though incompatible with current Self ) then my soltution could be
considerably simpler then as I presented it.
Have fun at oopsla ( it is next week, right? )
-- Jecel