lua-users home
lua-l archive

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


Tomas Guisasola Gorham <tomas@ccpa.puc-rio.br> wrote:
> function E (t)
>    if type(t) == "table"then
>       return function () return args[1](E(args[2]), E(args[3])) end
>    else
>       return t
>    end
> end
> 
> 	and write the expressions like:
> 
> E{add, 7, {mul, 4, 3}}
> 
> 	I didn't tested it, but it's just for the idea.  I think
> lhf has answered with a solution similar to that, but without the
> function construction, isn't it?

That's an elegant solution but it still involves alot of extra function calls.

Steve