lua-users home
lua-l archive

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


On Mon, Aug 10, 2009 at 12:59 PM, Luiz Henrique de
Figueiredo<lhf@tecgraf.puc-rio.br> wrote:
>> In my experience, Lua with a 32-bit integer core is covering 95+% of
>> our needs. However, sometimes you just need to represent something
>> that is larger (file/disk sizes, traffic counters, ...) or you need
>> non-integer arithmetic. Using userdata in these cases is just awkward.
>
> Why is it awkward? I se that creating an object is a bit awkward, as in
>        one = real(1)
>        half = real(1,2)        -- 1/2
> but from then on the metamethods should make it transparent:
>        x = (r+2/r)/2
> Am I missing something?

Well, the values are mostly coming from a binding to our configuration
backend. Having to treat certain parameters in a special way would
complicate that binding. I agree that with metamagic it will almost be
transparent for the users but I'm a bit afraid of that 'almost'. Our
users are not always experienced programmers so the less they (and me)
have to worry about the internals the better.

-- 
Dirk