diff --git a/src/kiss/Macros.hx b/src/kiss/Macros.hx index b6003e35..048229c6 100644 --- a/src/kiss/Macros.hx +++ b/src/kiss/Macros.hx @@ -48,13 +48,13 @@ class Macros { // TODO when - // Under the hood, (defmacro ...) defines a runtime function that accepts Quote arguments and a special form that quotes the arguments to macro calls - macros["defmacro"] = (exps:Array, k:KissState) -> { + // Under the hood, (defmacrofun ...) defines a runtime function that accepts Quote arguments and a special form that quotes the arguments to macrofun calls + macros["defmacrofun"] = (exps:Array, k:KissState) -> { if (exps.length < 3) - throw '${exps.length} is not enough arguments for (defmacro [name] [args] [body])'; + throw '${exps.length} is not enough arguments for (defmacrofun [name] [args] [body])'; var macroName = switch (exps[0]) { case Symbol(name): name; - default: throw 'first argument ${exps[0]} for defmacro should be a symbol for the macro name'; + default: throw 'first argument ${exps[0]} for defmacrofun should be a symbol for the macro name'; }; k.specialForms[macroName] = (callArgs:Array, convert) -> { ECall(Context.parse('${k.className}.${macroName}', Context.currentPos()), [ diff --git a/src/test/cases/BasicTestCase.kiss b/src/test/cases/BasicTestCase.kiss index 6d5f482a..533bbc40 100644 --- a/src/test/cases/BasicTestCase.kiss +++ b/src/test/cases/BasicTestCase.kiss @@ -63,7 +63,7 @@ (defvar myIf7 (if "string" true false)) (defvar myIf8 (if "" true false)) -(defmacro doTwiceInt [intOp] +(defmacrofun doTwiceInt [intOp] ,intOp ,intOp) @@ -71,6 +71,6 @@ (defun incrementTwice [val] (doTwiceInt ++val)) -(defmacro doTwiceString [stringOp] +(defmacrofun doTwiceString [stringOp] ,stringOp ,stringOp) \ No newline at end of file