lua-users home
lua-l archive

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




On 2018-03-11 12:49 PM, Albert Chan wrote:
c function called from lua that supposed to return nil,
can I simplify code by return 0, instead of lua_pushnil(L); return 1 ?

Seems both accomplish the same thing.

function no_return () end

= no_return() == nil
true

x = 123
x = no_return()
= x
nil





select("#", no_return()) == 0

--
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.