lua-users home
lua-l archive

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


Sven Olsen <sven2718@gmail.com> writes:
> lparser:body()'s new_localvarliteral() call from "self" to LUA_ENV, thus
> changing the ":" function declaration sugar from
...
> This is a breaking change, in the sense that it has good odds of
> profoundly changing the semantics of vanilla lua code.  It also leads
> to much more concise object definitions, implying that most of the
> time, there's no longer any need to prefix member variables with self.

Er, yeah, but at the cost of essentially completely severing any
connection with the enclosing module!!!  Given that the _ENV typically
contains stuff like module imports, etc., that's a pretty serious
restriction... so it could maybe work for very simple method
definitions, but it doesn't seem a good general recipe.

[As one _can_ explicitly write the _ENV version already, it seems
better to just let people do that in those cases where it works, and
leave the default behavior alone.]

-miles

-- 
P.S.  All information contained in the above letter is false,
      for reasons of military security.