lua-users home
lua-l archive

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

On 25 January 2015 at 16:10, SilverWingedSeraph <> wrote:
> Note: resending because I think it didn't send, last time. If it did, feel
> free to yell at me :)
> I'm working on a vector math library called Vectorial, I put a link to it up
> on the wiki yesterday. It currently does 2D and 3D vectors and basic vector
> operations, in normal precision. I'm going to eventually extend it with
> n-dimensionality and arbitrary precision. I'd appreciate comments! It's at

Namespacing suggestion: if you already have a suggested table name for
loading the module (`v2d` and `v3d`), use that as the module name. You
can exploit namespaces to your favor, like this:

local v2d = require "vectorial.v2d"

and store the file as vectorial/v2d.lua.

This is not a rule set in stone of course, but last time we discussed
this everyone seemed to agree it's a good idea unless you have a good
reason not to:

"always require a module into a local named after the last component
of the module’s full name" -- me in

"I tend to do that, but not always." -- Pierre Chapuis in
(check out his exceptions list)

"it is not required that the table variable is called the same as the
file - although it helps" -- Enrique 'Kikito' García in

-- Hisham