It was thus said that the Great Dirk Laurie once stated:
Op Wo., 31 Okt. 2018 om 16:38 het Hisham <email@example.com> geskryf:
I'm slightly annoyed that basic Lua module examples often display
messy naming practices. Here, the module is written named as "M",
stored in a file called "mymodule" and required into a variable "vec".
I understand that this is to didactically showcase that the names are
not _required_ to be the same, but it promotes those practices (which
are sadly common among Lua programmers, probably due to top-down
examples like this) and IMO it makes the module system look even more
I have no problem with what Lua programmers do. In fact local renaming
is to my mind good practice.
The package name is "lua-xml". The file is "LuaXml.lua". The resulting
module name is "xml". Annoying as hell.
local json = require"org.conman.parsers.json"
Nothing wrong with that.
No. But there, the package name is 'org.connman.parsers.json'. The file
is 'org/conman/parsers/json.lua'. And the resulting module is named ...
well, in this case, it would be a local variable named 'json'. There's a
logical progression one can follow.
I do have a problem with what some Lua package writers do. The actual
name to be required is something Unixly cryptic like lfs or lom. but
the package name is longer (luafilesystem) and may even have nothing
to do with the module name (luaexpat). BTW why must the package name
start with or contain the tautological "lua"?