-- Implementing functions using goto statements
line = 1;
func = 1;
argl = {};
ret = {};
-- Function Foo
goto ENDFOO;
::FOO::
print("foo");
func = func + 1;
::ENDFOO::
-- Function Add
goto ENDADD;
::ADD:: -- num x, num y
ret = argl[1] + argl[2];
print(ret);
argl = {};
func = func + 1;
::ENDADD::
----------
-- MAIN --
----------
if func == 1 then
goto FOO;
end
if func == 2 then
argl = {1,2};
goto ADD;
end