Re: [GD-General] Re: Scripting Systems
Brought to you by:
vexxed72
From: <cas...@ya...> - 2004-02-01 20:59:07
|
Brian Hook wrote: >>You can do that without "hacking" lua. This is from the top of my >>head, but if you want to follow this direction I can provide a more >>detailed explanation > > This catches assignments at run-time though, not at compile time, > correct? ups, should read mails more carefully! yes, that catches errors at run time only. It's not possible to do that at compile time without fully redesigning the language. However, that allows you to catch errors earlier, and provides a descriptive error message to let you know what's going on. ie. If you use 'healht' instead of 'health' in your 'weapon_hit' function, at runtime you wouldn't know why can't you kill your target, but with the newindex metamethod those errors would show up as soon as the offending code is executed. In my experience (that's not much :D), this kind of runtime checks and a proper test suite can be really helpful. -- Ignacio Castaño cas...@ya... |