|
|
|
|
|
by catnaroek
4689 days ago
|
|
To be honest, I have no idea how to implement the exact operational semantics of prototypal inheritance in a dynamic language with classes. (Perhaps it is possible, but I would not bet on it.) In JavaScript, objects are statically known to be internally a pair of a base reference and a hashmap. In Python, you can define a tuple or class that has a base reference and a hashmap as members, but internally your program will test for the existence of these members all the time. So, different semantics. But a static OO language can faithfully reproduce the operational semantics of prototypal inheritance. |
|
Edit: Now with method binding that works instead of not working!