lua-users home
lua-l archive

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


John Belmonte wrote:
> If you have control over the Lua environment it would make more sense to
> just export the info available to C.  For example from <float.h>:
> 
>     DBL_DIG
>     DBL_EPSILON
>     DBL_MANT_DIG
>     DBL_MAX
>     DBL_MAX_10_EXP
>     DBL_MAX_EXP
>     DBL_MIN
>     DBL_MIN_10_EXP
>     DBL_MIN_EXP

Actually, I was quite too much on the Lua side to think about the
underlaying C code... And franckly, I didn't knew these constants (by their names, at
least).
We must admit we don't frequently goes to these limits, anyway, since they
are quite big.
My test was an excuse to write another Lua snippet, with a nice trick to
avoid lengthly loops. And it gives practical, real values. After all, I could be
a pure Lua programmer, ie. without access to a C compiler.
Thank you anyway.

BTW, I have a little grudge again the manual of the 4.0 version... It often
make reference to the C documentation (eg. for the printf formats, the math
functions, or the date function). I understand that, as it eases the writing,
lighten the document, and avoid paraphrasing.
But since Lua is intended to be used, among others, by people with little
programming knowledge, a non self-contained manual is a bit annoying.

That said, I must add that actually, if I ever release a program using Lua
exposed to end users, I will probably rewrite my own manual (taking liberal
parts of the existing one, if it is allowed), carefully omitting some parts
(like API, debugging, perhaps tags, etc.) and adding explainations for the
libraries I could have written.

Regards.

-- 
--._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.--
Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist
http://jove.prohosting.com/~philho/
--´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`·._.·´¯`--

Sent through GMX FreeMail - http://www.gmx.net