lua-users home
lua-l archive

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

> On Fri, Dec 08, 2000 at 12:04:37PM -0800, Falko Poiker wrote:
> > Has anyone here modified lua to be case insensitive?  Since we 
> > have a whole lot of designers poised to do lua scripting, I want 
> > to avoid them having to debug capitalization errors.  As such, 
> > I'd like to modify lua so that it ignores case - at least with 
> > variable/function names.  Is there an easy way to do this?

> Better instead to put in setglobal/getglobal functions that check 
> whether the variable has been earlier "declared" by calling a 
> special function.  Then you can remove these once you're done 
> with the code to get rid of the performance hit.  This would 
> take care of case mistakes as well as typos.

Interesting idea.  Did you use the getglobal(NIL) tagmethod for this?

The difference in our game is that we're planning on exposingthe lua 
layer to mod groups so they can modify ai, as well as other scripted 
variables and functions.  Of course we could let those people run the 
game in "developer mode" that turns on the case/spelling check (with 
the accompanying performance hit).

There is also the aformentioned problem of local variables.  If 
globals are checked and locals are not, it could discourage designers 
from using local variables...

> We started using that at the beginning of Monkey... Not only did 
> it catch lots of mistakes, but it encouraged people to document 
> what variables did at the opint where they "declared" them.
How exactly does this system encourage documentation?  I think it's 
a great idea, but it's not obvious to me how this works.