let noargmacro = macro() => { field1 = "value", }; let simplemacro = macro(arg1, arg2, arg3) => { field1 = arg1, field2 = arg2, field3 = arg3, }; let cplxmacro = macro(argint, argstr, argfloat) => { field1 = argint + 1, field2 = argstr + " are here", field3 = argfloat - 1.0, boolfield = argint == 1, }; let noargresult = noargmacro(); let simpleresult = simplemacro(1, 2, 3); let cplxresult = cplxmacro(1, "We", 3.0); assert | noargresult.field1 == "value"; |; assert | simpleresult.field1 == 1; |; assert | simpleresult.field2 == 2; |; assert | simpleresult.field3 == 3; |; assert | cplxresult.field1 == 2; |; assert | cplxresult.field2 == "We are here"; |; assert | cplxresult.field3 == 2.0; |; assert | cplxresult.boolfield == true; |; let macro_tpl_arg = macro(tpl) => { result = tpl.field, }; let arg_tpl = { field = "value", }; assert | macro_tpl_arg(arg_tpl).result == arg_tpl.field; |;