lua-users home
lua-l archive

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

> 	Would you provide a "smart" (not a good name, but you know
> what I mean :-) format to read a number in whatever format (as "*n")
> but return an integer (as "*i") if appropriate?
> 	In fact I don't use anything like that, just a thought :-)
> Suppose the file will provide table keys; there would be two conversions:
> from file (integer) to number (fp), then from number to key (integer).
> Unless I know all numbers are integers and use "*i".

I guess that, if you do not know what you are reading, the values could
also be strings, or booleans, or whatever, not only numbers. A "smart"
read should be able to read any basic Lua value, not only numbers.

-- Roberto