lua-users home
lua-l archive

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


>Oh, yes, I know the names "a priori". But this way EVERY time I use a
>global variable the tag method is called...

Yes, I'm aware of that. :-( You might also set the "index" TM on the global
table to check for the special names and if so compute them. In this way, the
special vars are never actually global vars. (If the values don't change, you
may add a cache table.)

>By the way, WHY are you removing the getglobal/setglobal methods? Just
>curious...

Oh, there's plenty of people out here in the list that think that this is the
"correct" way to go. Check the archives for heated discussions. This time we
just think it might make things simpler, with less special cases. But I think
this issue will only be cleared when we figure out how to do "global"
declarations.

Please don't get us wrong. Our main aim is just to build a powerful and simple
language. We care a lot for our users and their effort in using Lua. But
sometimes, as in the case of the preprocessor, we made a bad decision and we go
back and remove the "feature". Sometimes, historical features begin to stand in
the way. The setglobal/setglobal methods come from a time when globals were
really distinct entities. We're moving to a Lua where they are no longer so
special; for instance, they are stored in an ordinary Lua table, with no special
rights. This prompted people here in the list to ask, "but then why are there
special setglobal/setglobal methods?". So, here we are. Let's see where we get,
with feedback from you all, of course.
--lhf