LSP (was Re: Function.prototype.bind)

waldemar at waldemar at
Wed Sep 24 16:57:09 PDT 2008

> This is seriously belaboring a point, but ... I'll try again. The LSP
> describes this subtype relationship here iff:
>    for every object o1 of type NotTheMulYoureLookingFor:
>      there is an object o2 of type Mul:
>        such that for all programs P:
>          the behavior of P(o2) is the same as P(o1)
> The only wiggle room I can see here is if you're saying that instances
> like o1 are also "objects of type Mul", such that you can let o2=o1 and
> trivially satisfy it.

Yes, that's what it means here.  The LSP applies because you can let
o1=o2.  This is not always a trivial transformation because in some
languages values of different types are not necessarily compatible.


More information about the Es-discuss mailing list