Re:Javascript Frameworks Are Amazing and Nobody Is Happy
by anonymoushn on Friday August 23, 2013 @04:21PM
(#6266034)
The difference between "checking for the existence of the proto key in a hash map" and "checking whether the proto pointer that I am certain to have points to NULL" is due entirely to the differences in the semantics of Python and C++. Is it important just to implement prototypes, or to ensure that the guts of the prototype system are the same as the guts of a particular JS implementation? I'm not sure precisely where the goalposts have gone, so here are some prototypes in Python. http://pastie.org/8263966
Edit: Now with method binding that works instead of not working!
But a static OO language can faithfully reproduce the operational semantics of prototypal inheritance.