LSP (was Re: Function.prototype.bind) [offtopic]

# David-Sarah Hopwood (17 years ago)

Graydon Hoare wrote:

Mark S. Miller wrote:

[LSP] still a good design rule ...

Yup,

As stated ("... the behavior of P is unchanged ..."), it's too strong. It should have been stated in terms of a subtype refining the specification of a supertype.

in languages (like JavaScript) with nominal subtyping (via instanceof).

Oh goodness, don't say that while the type theorists are in the room!

Indeed. ES3 has exactly one type, and it has no name.

# Jon Zeppieri (17 years ago)

On Wed, Sep 10, 2008 at 9:43 PM, David-Sarah Hopwood <david.hopwood at industrial-designers.co.uk> wrote:

Graydon Hoare wrote:

Mark S. Miller wrote:

[LSP] still a good design rule ...

Yup,

As stated ("... the behavior of P is unchanged ..."), it's too strong. It should have been stated in terms of a subtype refining the specification of a supertype.

in languages (like JavaScript) with nominal subtyping (via instanceof).

Oh goodness, don't say that while the type theorists are in the room!

Indeed. ES3 has exactly one type, and it has no name.

Does it? lambda-the-ultimate.org/node/100#comment