lua-users home
lua-l archive

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

Is there a compelling reason for not making 'require' and 'module'
keywords in the language.

Since I am working on a static analysis tool for Lua, handling Lua
modules is something I need to do. In doing so, I find myself
continually nagged by this question of why modules have a second class
status. Why is 'require' merely a function with the name 'require'?

The only reasons I can come up with is that modules (like almost
everything in Lua) are optional, and may not be included in embedded
Lua, and that they were built using lower level api's like setfenv.

That is fair enough. I was just wondering if adding the module system
as a language (grammar) feature vs a library had been considered and
if anyone had any additional insight on the matter.

Thanks In Advance,

Jon Akhtar