lua-users home
lua-l archive

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


>From: "Samson, Lyndon (GXS, Aerotek)" <Lyndon.Samson@gxs.ge.com>
>
>Is it still a requirement that the return statement is the last line in a
>function?

Yes.

>I know this conforms to some coding styles

No style, but syntax.
Otherwise, the code below is ambiguous, due to the lack of semicolons:
	return
	a()
Does this means
	return a()
Or return, never calling a() at all?

>but sometimes the ability to exit a function earlier on
>would be very useful.

Do
	do return end
Also
	if cond then return end

works of course.

--lhf