lua-users home
lua-l archive

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



On Mar 15, 2006, at 19:43, Alexander Gladysh wrote:

Any suggestions?

Would using a function environment by a reasonable alternative for you?

Something along these lines:

(1) Wrap your local syntax in a function

local Foo = function()
    return
    {
	    ["Alpha"] = { op1 "a", op2 "b" };
	    ["Beta"] = { op2 "a", op1 "b", op3 "c" };
    }
end

(2) Define the different operators necessary for the function environment

anEnvironment.op1 = function(var) ... end

setfenv( Foo, anEnvironment )

(3) Execute it

Foo()


Cheers

--
PA, Onnay Equitursay
http://alt.textdrive.com/