Quote:
Originally Posted by Kryso
And now I'm lost. Current class implementation doesn't create new or copy functions for each instance, they are stored in table that acts like both prototype and instance factory thanks to metatables. Making new copy of function instead of referencing it doesn't make any sense unless we need to access parent scope.
|
So let me get this straight, calling a function with a dot operator, i.e.
foo.bar();
will create a copy of that function each time it's called.
However, setting a variable with a dot operator, i.e.
foo.bar = 1;
won't create a copy of the variable each time it's set/used?