shithub: femtolisp

Download patch

ref: e9039ef075ee2d96fbd8dd6eae191448acf43751
parent: 0183f1511656d53e02d2dd7b8acd001980517a14
author: Sigrid Solveig Haflínudóttir <[email protected]>
date: Sat Apr 1 13:50:59 EDT 2023

change the message argcount produces on error

--- a/flisp.h
+++ b/flisp.h
@@ -224,13 +224,12 @@
 _Noreturn void bounds_error(value_t arr, value_t ind);
 _Noreturn void unbound_error(value_t sym);
 extern value_t ArgError, IOError, KeyError, MemoryError, EnumerationError;
-#define argcount(nargs, c)                                \
-    do {                                                  \
-        if (__unlikely(nargs != c)) {                     \
-            lerrorf(ArgError,                             \
-                "too %s arguments (want %d, got %d)",     \
-                nargs < c ? "few" : "many", c, nargs);    \
-        }                                                 \
+#define argcount(nargs, c)                                      \
+    do {                                                        \
+        if (__unlikely(nargs != c)) {                           \
+            lerrorf(ArgError,                                   \
+                "arity mismatch: wanted %d, got %d", c, nargs); \
+        }                                                       \
     } while(0)
 
 typedef struct {