lua-users home
lua-l archive

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


On Apr 23, 2008, at 5:58 AM, Luiz Henrique de Figueiredo wrote:

That's hardly an excuse for not having a round function.

No excuses are needed. Lua's philosophy is minimalist. Since Lua libraries are easily extended either in C or in Lua, you can simply add a math.round
function that suits you.

I have long appreciated Lua's minimalist philosophy. What I think a lot of the community is looking for, however, are standards about how to extend if it is going to be extended.

In adding a rounding function, there's a disincentive to add it to math itself because the Lua distribution conceptually controls that namespace. So one adds mymath.round. (Lightroom has AgMathUtils.round.) But then everyone goes off and re-invents this and when one wants to share code we run into problems.

I think defining a standard set of extensions to Lua for use in particular environments would be a valuable enhancement to the distribution. It's a process the community has tried to undertake but without a formal process, it's hard to reach a conclusion.

Mark