View Single Post
  #5  
Unread 10-07-2010, 02:25 PM
Kryso Kryso is offline
The Undefeated
 
Join Date: Oct 2010
Posts: 8
And this example would fail again, because there would be no "self" (or at least no valid self).

Code:
function Table:Foo( arg )
    self.bar= self.bar+ arg;
end
is just syntactic sugar for

Code:
Table.Foo = function( self, arg )
    self.bar = self.bar + arg;
end
and

Code:
Table:Foo( 1 );
is the same as

Code:
Table.Foo( Table, 1 );
Reply With Quote