diff --git a/kiss/src/kiss/Macros.hx b/kiss/src/kiss/Macros.hx index c6c576ae..29763305 100644 --- a/kiss/src/kiss/Macros.hx +++ b/kiss/src/kiss/Macros.hx @@ -180,33 +180,6 @@ class Macros { ]).withPosOf(wholeExp); }; - // 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"] = (wholeExp:ReaderExp, exps:Array, k:KissState) -> { - wholeExp.checkNumArgs(3, null, "(defmacrofun [name] [args] [body...])"); - var macroName = switch (exps[0].def) { - case Symbol(name): name; - default: throw CompileError.fromExp(exps[0], 'first argument for defmacrofun should be a symbol for the macro name'); - }; - var macroNumArgs = switch (exps[1].def) { - case ListExp(argNames): argNames.length; - default: throw CompileError.fromExp(exps[1], 'second argument of defmacrofun should be a list of argument names'); - }; - k.specialForms[macroName] = (wholeExp:ReaderExp, callArgs:Array, convert) -> { - // Macro functions don't need to check their argument numbers - // because macro function calls expand to function calls that the Haxe compiler will check - ECall(Context.parse('${k.className}.${macroName}', wholeExp.macroPos()), [ - for (callArg in callArgs) - EFunction(FArrow, { - args: [], - ret: null, - expr: EReturn(k.convert(callArg)).withMacroPosOf(wholeExp) - }).withMacroPosOf(wholeExp) - ]).withMacroPosOf(wholeExp); - }; - - CallExp(Symbol("defun").withPosOf(wholeExp), exps).withPosOf(wholeExp); - } - macros["defreadermacro"] = (wholeExp:ReaderExp, exps:Array, k:KissState) -> { wholeExp.checkNumArgs(3, 3, '(defreadermacro ["[startingString]" or [startingStrings...]] [[streamArgName]] [RawHaxe])'); diff --git a/kiss/src/kiss/Reader.hx b/kiss/src/kiss/Reader.hx index 5d31afd0..a2e27714 100644 --- a/kiss/src/kiss/Reader.hx +++ b/kiss/src/kiss/Reader.hx @@ -53,8 +53,6 @@ class Reader { }; readTable["#|"] = (stream) -> RawHaxe(stream.expect("closing |#", () -> stream.takeUntilAndDrop("|#"))); // For defmacrofuns, unquoting with , is syntactic sugar for calling a Quote (Void->T) - readTable[","] = (stream) -> CallExp(assertRead(stream, readTable), []); - // If/when proper defmacro is added, reading every Unquote directly as a CallExp won't work anymore readTable[":"] = (stream) -> TypedExp(nextToken(stream, "a type path"), assertRead(stream, readTable)); diff --git a/kiss/src/test/cases/BasicTestCase.hx b/kiss/src/test/cases/BasicTestCase.hx index 379e326f..a2609966 100644 --- a/kiss/src/test/cases/BasicTestCase.hx +++ b/kiss/src/test/cases/BasicTestCase.hx @@ -112,15 +112,6 @@ class BasicTestCase extends Test { _testIf(); } - function testMacros() { - Assert.equals(7, BasicTestCase.incrementTwice(5)); - - var seasonsGreetings = "ho "; - Assert.equals("ho ho ho ", BasicTestCase.doTwiceString(() -> { - seasonsGreetings += "ho "; - })); - } - // TODO to really test typed variable definitions, check for compilation failure on a bad example function testTypedDefvar() { Assert.equals(8, BasicTestCase.myInt); diff --git a/kiss/src/test/cases/BasicTestCase.kiss b/kiss/src/test/cases/BasicTestCase.kiss index b83d87c1..881dbda4 100644 --- a/kiss/src/test/cases/BasicTestCase.kiss +++ b/kiss/src/test/cases/BasicTestCase.kiss @@ -92,18 +92,6 @@ (defvar :Int myInt 8) -(defmacrofun doTwiceInt [intOp] - ,intOp - ,intOp) - -// I think this causes doTwiceInt's runtime function to be typed as requiring Quote and returning Int -(defun :Int incrementTwice [:Int val] - (doTwiceInt ++val)) - -(defmacrofun doTwiceString [stringOp] - ,stringOp - ,stringOp) - (defun myTryCatch [:Any e] (try (throw e)