From 67cdf396b5289e40947075993251cf988d2e0526 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Wed, 12 Mar 2025 09:19:38 -0500 Subject: [PATCH] Don't warn that ++, -- exps are unused --- src/kiss/SpecialForms.hx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/kiss/SpecialForms.hx b/src/kiss/SpecialForms.hx index 2f9a8ea..f01b4c7 100644 --- a/src/kiss/SpecialForms.hx +++ b/src/kiss/SpecialForms.hx @@ -42,6 +42,7 @@ class SpecialForms { k.formDocs[newName] = k.formDocs[oldName]; } + var unops = ["++", "--"]; map["begin"] = (wholeExp:ReaderExp, args:Array, k:KissState) -> { // Sometimes empty blocks are useful, so a checkNumArgs() seems unnecessary here for now. @@ -53,7 +54,7 @@ class SpecialForms { } for (bodyExp in args) { switch(bodyExp.def) { - case Symbol(_) if (lastArg != null): + case Symbol(name) if (lastArg != null && !unops.contains(name.substr(0, 2)) && !unops.contains(name.substr(name.length - 2, 2))): KissError.warnFromExp(bodyExp, "This looks like an unused value"); default: }