lua-users home
lua-l archive

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


On 6 Sep 2018, at 9:18 pm, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> 
> Op Do., 6 Sep. 2018 om 19:34 het Tom Sutcliffe <tomsci@me.com> geskryf:
> 
>> The only thing that I'd really get rid of is the implicit string/number conversions.
> 
> Well, it's already in Lua 5.3 as simple compiling with NOCVTS2N, and
> in Lua 5.4 you don't need to recompile, just assign nil to the
> offending string metamethods.

I didn't realise that LUA_NOCVTN2S disabled the lua_tolstring automatic conversions (I thought it controlled just the Lua-side ones like "a"..1). Now that I look, it does indeed. I've learnt something today!

Now I'm really kicking myself for not enabling those in my last project, maybe I can quietly sneak them in with enough testing of all the existing code... (I was trying to be as close to stock Lua as possible, at the time, but it has progressed to the point where I probably could safely change this).

Cheers,

Tom