lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Fri, Oct 20, 2000 at 10:10:51PM -0200, Luiz Henrique de Figueiredo wrote:
> >function Matrix:delete()
> >   self = nil
> >end
> 
> despite the appeareances, this does not set the value of the caller object to
> nil: it only sets the value of the local variable 'self' to nil.
> this variable is an ordinary local variable (except that it's implicit),
> which is initialized to the value of the caller object.

What languages are there which don't have the behavior Lua does?


For example, C++ and Python both do the same thing Lua does. 

** C++

void MyObject:my_method(void) {
  this = NULL;  // this is just an implied local variable
}

** Python

class MyObject:
  def my_method(self):
    self = none  // in Python it's more explicit somewhat like lua




-- 
David Jeske (N9LCA) + http://www.chat.net/~jeske/ + jeske@chat.net