lua-users home
lua-l archive

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


On Sun, May 18, 2008 at 10:01:17AM -0600, ddneilson wrote:
<snip>
> >Note, I do think it would be nice if there an optional way to get the
> >"splicing" behavior you want, for those times when you know it's the
> >right thing.
> >
> >E.g., some sort of "@splice ..." special-form which would tell the
> >compiler to keep all values:
> >
> >   fun1 (fun2(), @splice fun3(), @splice fun4(), fun5())
> >
> >would keep only the first result of fun2, but would keep all results
> >from fun3, fun4, and fun5.
> >
> I really like this idea. Maintains backward compatibility, and adds
> useful additional functionality. Can anyone "in the know" comment on how
> difficult it would be to add something like this to the Lua
> compiler/interpreter?
>
> -Daniel

I believe Rici had at one point created a patch for this (at least during
table creationg, I'm less sure about function calling) which used ;
instead of the normal , to indicate the full return value expansion. I
don't know if he ever did anything with it (like put it up on the wiki or
anything).

	-Etan