---- implementing try...except local stack = {} local push = table.insert local pop = table.remove local name = macro.name local global = macro.global macro.define('try',{'L1','L2',handle_parms = true}, @ local L1,L2 = pcall(function() @, function() local L1 = global() local L2 = global() push(stack,{L1,L2}) return name(L1),name(L2) end) macro.define('except',{'L1','L2',handle_parms = true}, @ end) if not L1 then local e = L2 @, function(ls) local t = pop(stack) if not t then macro.error("mismatched try..except",ls.line) end return name(t[1]),name(t[2]) end)