Re: [caplet] Re: ADsafe rules
- On Sun, Apr 6, 2008 at 12:30 PM, Mike Samuel <mikesamuel@...> wrote:
> Does anyone know the rationale for putting joining in the spec in the firstI'd guess it was to enable the optimization that David was suggesting.
But I don't actually know.
- --- In email@example.com, "Kris Zyp" <kris@...> wrote:
> > If functions were immutable, joining would be a transparentoptimization.
> > Apart from the theoretical potential for backward incompatibility, whyfunctions is pretty core functionality, and AFAIK it is necessary to
> > isn't this a better solution? I suspect that very few programs rely on
> > mutating actual functions
> Really? It is actually even used in ADsafe's core library. Mutating
form multi-level prototypical inheritance. If I want object A to
delegate/inherit from preexisting object B, I must create a function
and set the prototype (a mutation) to object B and then construct with
that function. See the beget function in ADsafe.
beget is a workaround for the lack of an operator that produces an
object with a delegation relationship. It should not be interpreted as
proof that mutable functions are desirable.