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

Re: Does self allow recursion?



> Anyway, from what I gathered about the language, a method is in fact
> an object. The slots of a "method object" act as local variables.  I
> may have missed it, but I don't recall any discussion about "method
> activations" or such.  If they don't exist, then I guess Self will
> suffer the same problems as Fortran did, and disallow recursion.

When a method is invoked, it is *cloned*, and the clone's slots are
filled in with the actual arguments.  Thus, an activation is a clone
of the method object, and recursion works just fine (see section 2.4.2
of the reference manual).

-Urs