[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: C function results
- From: RLake@...
- Date: Fri, 27 Jun 2003 09:30:52 -0500
> Is there a difference between using
> in C functions?
Sometimes. It is the same as the difference between
in Lua functions.
If the function is called in a multiple-return context, it makes a
difference, but it is not very easy to see this difference from Lua. On
the other hand, it is quite possible to see the difference if the function
is called from C; I would say that the bug is then in the C call, rather
than the function returning (or not) the value, but that's a matter of
Here is an example of where it would make a difference:
function return_nil() return nil end
function return_nothing() return end
-- the return could be left out of return nothing,
-- I just put it in to be explicit
> -- force the context to be single-value return