lua-users home
lua-l archive

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


On Jul 18, 2010, at 3:08 AM, Florian Weimer wrote:

> I think misspelling is sort of a red herring here.  The main issue is
> consistent spelling, but using a global when a local was appropriate.
> The code appears to work perfectly well, but it is not reentrant,
> which means that it cannot be used reliably from co-routines.  Worse,
> it is non-reentrant with respect to other code which happens to misuse
> the same global.

Roberto has cited his concern as preventing inadvertent writes to globals.

My observation from Lightroom was that that wasn't our primary concern, so I've been a bit puzzled. (Our concern much more centered around reading or writing something that isn't what you meant to because you spelled it wrong -- for a generous use of the term "spell" that also includes getting the terminology or naming wrong.)

Could the inadvertent writes to globals issue be more accurately described as avoiding creating code that isn't re-entrant, doesn't cooperate well, etc because of the use of globals where locals would have done perfectly well? Or are there other issues to be prevented by targeting writes but not reads?

Mark