[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Proposal: lua_pushfoo() should return 1
- From: Dirk Laurie <dirk.laurie@...>
- Date: Tue, 2 Sep 2014 08:01:11 +0200
2014-09-02 1:58 GMT+02:00 Rena <hyperhacker@gmail.com>:
> That would simplify returning a value slightly:
>
> return lua_pushinteger(L, 42);
>
> instead of:
> lua_pushinteger(L, 42);
> return 1;
It saves two non-whitespace characters, sometimes a pair
of braces too, at the expense of making life harder for the
person who reads the code. "return 1" is highly likely to be
in a function exported to Lua, "return <expresion>" often
is in a local function.