4 ms·
> Isn't this what most scripting languages do? I know it's the case with Python and PHP. This is false for Python: >> print bla NameError: name 'bla' is not
by rkrzr 11y ago
> Isn't this what most scripting languages do? I know it's the case with Python and PHP.
This is false for Python:
>> print bla
NameError: name 'bla' is not defined
In Lua:
> = bla
nil
- pygy_ 11y agoThat's yet another source of nil, but it can be fixed with modules like strict.lua, or simply setmetatable(_G or _ENV, {__index = error}) -- `error` for the example, you can write a function that prints a better error message.