[uim-commit] r1417 - branches/r5rs/sigscheme

yamaken at freedesktop.org yamaken at freedesktop.org
Sun Sep 4 15:37:57 PDT 2005


Author: yamaken
Date: 2005-09-04 15:37:54 -0700 (Sun, 04 Sep 2005)
New Revision: 1417

Modified:
   branches/r5rs/sigscheme/sigschemeinternal.h
Log:
* sigscheme/sigschemeinternal.h
  - (CHECK_1_ARG, CHECK_2_ARGS, CHECK_3_ARGS, CHECK_4_ARGS,
    CHECK_5_ARGS):
    * Simplify
    * Add a suggestion about renaming these macros


Modified: branches/r5rs/sigscheme/sigschemeinternal.h
===================================================================
--- branches/r5rs/sigscheme/sigschemeinternal.h	2005-09-04 22:02:20 UTC (rev 1416)
+++ branches/r5rs/sigscheme/sigschemeinternal.h	2005-09-04 22:37:54 UTC (rev 1417)
@@ -145,18 +145,17 @@
  */
 
 /* Macros For Argnument Number Checking */
-#define CHECK_1_ARG(arg) \
-    (SCM_NULLP(arg))
-#define CHECK_2_ARGS(arg) \
-    (SCM_NULLP(arg) || SCM_NULLP(SCM_CDR(arg)))
-#define CHECK_3_ARGS(arg) \
-    (SCM_NULLP(arg) || SCM_NULLP(SCM_CDR(arg)) || SCM_NULLP(SCM_CDR(SCM_CDR(arg))))
-#define CHECK_4_ARGS(arg) \
-    (SCM_NULLP(arg) || SCM_NULLP(SCM_CDR(arg)) || SCM_NULLP(SCM_CDR(SCM_CDR(arg))) \
-     || SCM_NULLP(SCM_CDR(SCM_CDR(SCM_CDR(arg)))))
-#define CHECK_5_ARGS(arg) \
-    (SCM_NULLP(arg) || SCM_NULLP(SCM_CDR(arg)) || SCM_NULLP(SCM_CDR(SCM_CDR(arg))) \
-     || SCM_NULLP(SCM_CDR(SCM_CDR(SCM_CDR(arg)))) || SCM_NULLP(SCM_CDR(SCM_CDR(SCM_CDR(SCM_CDR(arg))))))
+/*
+ * TODO: rename appropriately
+ * Since 'CHECK' sounds a positive check as like as 'ASSERT', its opposite
+ * meaning may confuse users. So I suggest other name such as 'UNFILLED'.
+ *   -- YamaKen 2005-09-05
+ */
+#define CHECK_1_ARG(arg)  (NULLP(arg))
+#define CHECK_2_ARGS(arg) (CHECK_1_ARG(arg)  || NULLP(CDR(arg)))
+#define CHECK_3_ARGS(arg) (CHECK_2_ARGS(arg) || NULLP(CDDR(arg)))
+#define CHECK_4_ARGS(arg) (CHECK_3_ARGS(arg) || NULLP(CDR(CDDR(arg))))
+#define CHECK_5_ARGS(arg) (CHECK_4_ARGS(arg) || NULLP(CDDR(CDDR(arg))))
 
 /*=======================================
    Function Declarations



More information about the uim-commit mailing list