lua-users home
lua-l archive

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


On Tue, May 29, 2012 at 06:40:43PM -0300, Roberto Ierusalimschy wrote:
> > On C99 systems, we used to be able to use string.format("%a", foo) for
> > this, to get a hex float.  Unfortunately, some poor-quality (but
> > standards-compliant) C library implementations (ie, Micorosoft's)
> > explode in a sticky pile if you pass format modes they don't support,
> > rather than just ignoring them.  So modern Luas check what format
> > strings are used and avoiding anything that isn't in C89.
> 
> I am not sure what is your concept of modern, but at least since
> version 4.0 Lua refuses unknown format modes:
> 
>   $ Lua 4.0.1  Copyright (C) 1994-2000 TeCGraf, PUC-Rio
>   > print(format("%a", 13))
>   error: invalid option in `format'
> 
> (Maybe you mistaken 'string.format' for 'os.date'.)

It's possible.  I have been using Lua for a while, since before Lua 4.0
:)

B.