Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It does have full lexical scoping, however "global by default" is good for scripting, questionable for standalone programming.

I general yes Lua is a great language, I have a lot of fun writing in it. But it does have its warts (though fewer than Javascript).



For what it's worth, you can use the local keyword to limit the scope of variables.

http://www.lua.org/pil/4.2.html


Have you heard of moonscript[1]? It is a bit quirky but makes var declarations local by default.

[1] http://moonscript.org/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: