diff --git a/kiss/src/kiss/Kiss.hx b/kiss/src/kiss/Kiss.hx index 79005c81..669d41b4 100644 --- a/kiss/src/kiss/Kiss.hx +++ b/kiss/src/kiss/Kiss.hx @@ -71,10 +71,10 @@ class Kiss { "print" => Symbol("Prelude.print"), "sort" => Symbol("Prelude.sort"), "groups" => Symbol("Prelude.groups"), - "pairs" => Symbol("Prelude.pairs"), // TODO test pairs - "reversed" => Symbol("Prelude.reversed"), // TODO test reversed - "memoize" => Symbol("Prelude.memoize"), // TODO test memoize - "fsMemoize" => Symbol("Prelude.fsMemoize"), // TODO test fsMemoize + "pairs" => Symbol("Prelude.pairs"), + "reverse" => Symbol("Prelude.reverse"), + "memoize" => Symbol("Prelude.memoize"), + "fsMemoize" => Symbol("Prelude.fsMemoize"), "symbolName" => Symbol("Prelude.symbolName"), "symbolNameValue" => Symbol("Prelude.symbolNameValue"), "symbol" => Symbol("Prelude.symbol"), diff --git a/kiss/src/kiss/Prelude.hx b/kiss/src/kiss/Prelude.hx index c3cd7d76..95d8df4f 100644 --- a/kiss/src/kiss/Prelude.hx +++ b/kiss/src/kiss/Prelude.hx @@ -260,7 +260,7 @@ class Prelude { return zipThrow(l1, l2); } - public static function reversed(l:kiss.List):kiss.List { + public static function reverse(l:kiss.List):kiss.List { var c = l.copy(); c.reverse(); return c; diff --git a/projects/aoc/src/year2021/Solutions2021.kiss b/projects/aoc/src/year2021/Solutions2021.kiss index fc0aa5d2..65f98b7f 100644 --- a/projects/aoc/src/year2021/Solutions2021.kiss +++ b/projects/aoc/src/year2021/Solutions2021.kiss @@ -63,7 +63,7 @@ realBasins (for =>lp _ realLowPoints (basinAround lp "src/year2021/inputs/day9.txt")) basinSizes (for b realBasins (count b))] (assert (= 480 (apply + (for =>_ height realLowPoints (+ 1 height))))) - (assert (= 1045660 (apply * (.slice (reversed (sort basinSizes)) 0 3)))))) + (assert (= 1045660 (apply * (.slice (reverse (sort basinSizes)) 0 3)))))) (day 10 (load "day10.kiss") (assert (= 462693 (apply + (map (map (Util.readLines "src/year2021/inputs/day10.txt") getLineType) score)))) diff --git a/projects/aoc/src/year2021/day10.kiss b/projects/aoc/src/year2021/day10.kiss index 6675e51b..ba3c0b13 100644 --- a/projects/aoc/src/year2021/day10.kiss +++ b/projects/aoc/src/year2021/day10.kiss @@ -24,7 +24,7 @@ (let [&mut :Float score 0] (case line ((Incomplete expected) - (doFor char (reversed expected) + (doFor char (reverse expected) (*= score 5) (+= score (case char (")" 1) diff --git a/projects/aoc/src/year2021/day3.kiss b/projects/aoc/src/year2021/day3.kiss index f922998f..e98dc7d0 100644 --- a/projects/aoc/src/year2021/day3.kiss +++ b/projects/aoc/src/year2021/day3.kiss @@ -1,7 +1,7 @@ // Silly but fun implementation of a binary->decimal conversion (function :Int binaryStringToDecimal [:String binary &opt :Bool invert] (apply + - (for [idx digit] (enumerate (reversed (binary.split ""))) + (for [idx digit] (enumerate (reverse (binary.split ""))) (* (let [digit (Std.parseInt digit)] (if invert (- 1 digit) digit)) (^ 2 idx))))) diff --git a/projects/aoc/src/year2021/day5.kiss b/projects/aoc/src/year2021/day5.kiss index 958d75dd..23917acd 100644 --- a/projects/aoc/src/year2021/day5.kiss +++ b/projects/aoc/src/year2021/day5.kiss @@ -11,7 +11,7 @@ e (max start end)] (let [r (collect (range s (+ e 1)))] (if (> start end) - (reversed r) + (reverse r) r)))) (function :Array pointsCoveredBy [:Line line :Bool part2] diff --git a/projects/kiss-vscode/syntaxes/kiss.tmLanguage b/projects/kiss-vscode/syntaxes/kiss.tmLanguage index 56a00281..1f31553f 100644 --- a/projects/kiss-vscode/syntaxes/kiss.tmLanguage +++ b/projects/kiss-vscode/syntaxes/kiss.tmLanguage @@ -116,7 +116,7 @@ match - (?<=\()(?i:\*|\*\*|\*\*\*|\+|\+\+|\+\+\+|\-|/|//|///|/=|<|<=|=|>|>=|and|apply|assert|begin|break|case|catch|concat|cond|continue|count|defMacro|defReaderMacro|defun|defmethod|method|function|defvar|var|defprop|prop|for|doFor|eighth|eval|fifth|first|fourth|localFunction|localVar|symbol|if|load|withFunction|withFunctions|lambda|last|let|loop|map|max|min|ninth|not|nth|setNth|getDict|setDict|or|otherwise|print|rest|return|reversed|second|set|sixth|Some|sort|symbolName|symbolNameValue|tenth|the|third|throw|trace|when|unless|ifLet|whenLet|unlessLet|forCase|doForCase|with[A-Z]\S+)(?=\s+) + (?<=\()(?i:\*|\*\*|\*\*\*|\+|\+\+|\+\+\+|\-|/|//|///|/=|<|<=|=|>|>=|and|apply|assert|begin|break|case|catch|concat|cond|continue|count|defMacro|defReaderMacro|defun|defmethod|method|function|defvar|var|defprop|prop|for|doFor|eighth|eval|fifth|first|fourth|localFunction|localVar|symbol|if|load|withFunction|withFunctions|lambda|last|let|loop|map|max|min|ninth|not|nth|setNth|getDict|setDict|or|otherwise|print|rest|return|reverse|second|set|sixth|Some|sort|symbolName|symbolNameValue|tenth|the|third|throw|trace|when|unless|ifLet|whenLet|unlessLet|forCase|doForCase|with[A-Z]\S+)(?=\s+) name keyword.control.kiss diff --git a/projects/nat-archive-tool/src/nat/ArchiveController.kiss b/projects/nat-archive-tool/src/nat/ArchiveController.kiss index f0015c06..e298eb5c 100644 --- a/projects/nat-archive-tool/src/nat/ArchiveController.kiss +++ b/projects/nat-archive-tool/src/nat/ArchiveController.kiss @@ -110,7 +110,7 @@ (set lastChangeSet (the ChangeSet (Reflect.callMethod null command.handler collectedArgs))) (when lastChangeSet (ui.handleChanges archive lastChangeSet)))] // To facilitate asynchronous arg input via UI, we need to construct an insanely complicated nested callback to give the UI - (doFor arg (reversed command.args) + (doFor arg (reverse command.args) (set lastCollector (_composeArgCollector collectedArgs arg lastCollector))) (lastCollector)))