+/*
+ * SCM_WTA_DISPATCH
+ */
+
+extern SCM scm_call_generic_0 (SCM gf);
+
+#define SCM_WTA_DISPATCH_0(gf, arg, pos, subr) \
+ return ((gf) \
+ ? scm_call_generic_0 ((gf)) \
+ : scm_wta ((arg), (char *) (pos), (subr)))
+#define SCM_GASSERT0(cond, gf, arg, pos, subr) \
+ if (!(cond)) SCM_WTA_DISPATCH_0((gf), (arg), (pos), (subr))
+
+extern SCM scm_call_generic_1 (SCM gf, SCM a1);
+
+#define SCM_WTA_DISPATCH_1(gf, a1, pos, subr) \
+ return ((gf) \
+ ? scm_call_generic_1 ((gf), (a1)) \
+ : scm_wta ((a1), (char *) (pos), (subr)))
+#define SCM_GASSERT1(cond, gf, a1, pos, subr) \
+ if (!(cond)) SCM_WTA_DISPATCH_1((gf), (a1), (pos), (subr))
+
+extern SCM scm_call_generic_2 (SCM gf, SCM a1, SCM a2);
+
+#define SCM_WTA_DISPATCH_2(gf, a1, a2, pos, subr) \
+ return ((gf) \
+ ? scm_call_generic_2 ((gf), (a1), (a2)) \
+ : scm_wta ((pos) == SCM_ARG1 ? (a1) : (a2), (char *) (pos), (subr)))
+#define SCM_GASSERT2(cond, gf, a1, a2, pos, subr) \
+ if (!(cond)) SCM_WTA_DISPATCH_2((gf), (a1), (a2), (pos), (subr))
+
+extern SCM scm_apply_generic (SCM gf, SCM args);
+
+#define SCM_WTA_DISPATCH_n(gf, args, pos, subr) \
+ return ((gf) \
+ ? scm_apply_generic ((gf), (args)) \
+ : scm_wta (scm_list_ref ((args), SCM_MAKINUM ((pos) - 1)), \
+ (char *) (pos), \
+ (subr)))
+#define SCM_GASSERTn(cond, gf, args, pos, subr) \
+ if (!(cond)) SCM_WTA_DISPATCH_n((gf), (args), (pos), (subr))
+
+#ifndef SCM_MAGIC_SNARFER
+/* Let these macros pass through if
+ we are snarfing; thus we can tell the
+ difference between the use of an actual
+ number vs. the use of one of these macros --
+ actual numbers in SCM_VALIDATE_* and SCM_ASSERT
+ constructs must match the formal argument name,
+ but using SCM_ARG* avoids the test */
+