lua-users home
lua-l archive

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


On Wed, Dec 2, 2020 at 9:00 PM Andrew Gierth <andrew@tao11.riddles.org.uk> wrote:
>>>>> "孙世龙" == 孙世龙 sunshilong <sunshilong369@gmail.com> writes:

 孙世龙> I can't understand the explanation aforementioned at all. As
 孙世龙> far as I can see, there is no difference from the macro
 孙世龙> definition for lua_pushliteral:

 孙世龙> #define lua_pushliteral(L, s) lua_pushstring(L, "" s)

There is no difference _now_, but that was not true in the past (and may
become false again in the future, who knows).

--
Andrew.

In addition to this, it should also be noted that the definition for lua_pushliteral will (intentionally) provoke a compile-time error if you try to call it with something that isn't a string literal. If nothing else, this makes it clear that you're documenting your intent.

/s/ Adam