Last active
August 29, 2015 14:16
-
-
Save tolmasky/12920f84747cfefb9149 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Given object X | |
Given type A | |
if X isa A, BUT X.m isnot A::m | |
then I am unhappy. | |
For example (classical): | |
class A { func one() { return 1 } } | |
class B : A { func one() { return 2 } } | |
X = new B() | |
X isa A (true) | |
X.one !== A::one (true) | |
--> I'm unhappy. | |
For example (prototypal): | |
class A { func one() { return 1 } } | |
X.prototype = A; | |
X.one = func() { return 2 } | |
X isa A (true since X.prototype === A) | |
x.one !== A.one (true) | |
--> I'm unhappy | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment