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

Re: implicit self

On Wed, 13 Sep 1995 10:41:00 +0800
Randall.Smith@Eng.Sun.COM (Randy Smith) wrote:
>  [ examples cut out to save space ]
> So in the above examples, we have the method holder moving up and down
> the lookup path. But while "silly" is being looked up, and while "y" is
> being looked up, the virtual machine has its self marker on the same
> object. It would be odd to suddenly slip and let the self marker "drop
> down" to the currentContext just becasue the methodHolder is at
> currentContext.

I guess you are right about this. It was stupid of me to try to
unify "the current receiver" and "where the lookup starts" in this
way because it was actually only half of a solution - resends would
still keep these notions separate anyway.

> (We used to have local methods, does anyone recall how they evaluated?

If I am not mistaken, "inner methods" worked exactly like a block
followed by "value":

            2 + (| x | x: 3. x+1)  ===   2 + [| x | x: 3. x+1] value

On Wed, 13 Sep 1995 11:32:39 -0700
Mario.Wolczko@Eng.Sun.COM (Mario Wolczko) wrote:
> It seems to me that in this example
>    (| x = 4.
>       silly = (| p* = (| x = 2 |). |
>                  x )
>    |) silly
> we should get an ambiguous message error, but unfortunately we do
> not...the VM returns 4.

I see what you mean - the "self*" and "p*" are both immediate parents
of the executing method and both define "x". It certainly isn't worth
"fixing" the compiler for that case...

-- Jecel