[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Global access control
- From: rw20@...
- Date: Mon, 29 Dec 1997 11:48:46 -0500 (EST)
> >>From what I could understand from the manual, "print" is also a
> >global variable, isn't it? How come you can access "print" without
> >declaring it to be global? That looks weird...
>
> excellent point! and one of the reasons why we don't want to change anything
> right now. specially since lua already provides tools (metamechanisms!) for
> handling this. (of course, such tools are available at run time only.)
I have thigs setup to allow access to function. I have a version that
prevents assignment to functions unless they are declared in the global
list.
It's true that Lua can modify and restrict itself to control global
access, but there are several problems:
1. Lua can't modify enough tag methods to really fix things (ie. you can't
control plain table access), so have a really hacked up language when
you're done.
2. Runtime is just too late to detect these errors in a
server environment or other robust system, especially since no overhead is
added to Lua to do it at compile time.
3. You're adding runtime overhead.
Lua is a great mixture of power and simplicity. I can understand
reluctance to add a language modification at this point (it is a totally
optional one though). Anyway, there seems to be some interest in
global access control, and I don't think having everyone roll there own
strange solution is a good idea.
If no standard is adopted, I'll probably continue to modify the Lex code
and make my own version (though keeping up with new Lua releases will be
a pain). I'd be glad to post my Lua source files as a optional
non-standard solution, if that's allowed (is it?).
Russ