guile-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

guile/guile-core/libguile ChangeLog gsubr.c


From: Dirk Herrmann
Subject: guile/guile-core/libguile ChangeLog gsubr.c
Date: Wed, 06 Dec 2000 08:24:01 -0800

CVSROOT:        /cvs
Module name:    guile
Changes by:     Dirk Herrmann <address@hidden>  00/12/06 08:24:00

Modified files:
        guile-core/libguile: ChangeLog gsubr.c 

Log message:
        * Various minor cleanups.

CVSWeb URLs:
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/ChangeLog.diff?r1=1.1189&r2=1.1190
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/gsubr.c.diff?r1=1.33&r2=1.34

Patches:
Index: guile/guile-core/libguile/ChangeLog
diff -u guile/guile-core/libguile/ChangeLog:1.1189 
guile/guile-core/libguile/ChangeLog:1.1190
--- guile/guile-core/libguile/ChangeLog:1.1189  Wed Dec  6 07:16:58 2000
+++ guile/guile-core/libguile/ChangeLog Wed Dec  6 08:24:00 2000
@@ -1,5 +1,16 @@
 2000-12-06  Dirk Herrmann  <address@hidden>
 
+       * gsubr.c:  No need to include vector.h.
+
+       (scm_gsubr_apply):  Use SCM_GSUBR_MAX instead of hard-coded value.
+       Added FUNC_NAME wrapping.  Improved (temporarily?) disabled
+       debugging code.  Replaced SCM_IMP with SCM_NULLP.  Eliminated call
+       to ASRTGO.
+
+       (scm_init_gsubr):  Eliminated outdated comment.
+
+2000-12-06  Dirk Herrmann  <address@hidden>
+
        * async.c (SCM_ASYNCP):  Use SCM_TYP16 instead of SCM_GCTYP16.
 
        * eval.c (scm_m_vref, scm_m_vset, scm_m_define, SCM_CEVAL,
Index: guile/guile-core/libguile/gsubr.c
diff -u guile/guile-core/libguile/gsubr.c:1.33 
guile/guile-core/libguile/gsubr.c:1.34
--- guile/guile-core/libguile/gsubr.c:1.33      Tue Sep 26 13:11:22 2000
+++ guile/guile-core/libguile/gsubr.c   Wed Dec  6 08:24:00 2000
@@ -48,7 +48,6 @@
 #include "libguile/_scm.h"
 #include "libguile/procprop.h"
 #include "libguile/root.h"
-#include "libguile/vectors.h"
 
 #include "libguile/gsubr.h"
 
@@ -132,21 +131,24 @@
 
 SCM
 scm_gsubr_apply (SCM args)
+#define FUNC_NAME "scm_gsubr_apply"
 {
   SCM self = SCM_CAR(args);
   SCM (*fcn)() = SCM_SUBRF(SCM_GSUBR_PROC(self));
-  SCM v[10];                   /* must agree with greatest supported arity */
+  SCM v[SCM_GSUBR_MAX];
   int typ = SCM_INUM(SCM_GSUBR_TYPE(self));
   int i, n = SCM_GSUBR_REQ(typ) + SCM_GSUBR_OPT(typ) + SCM_GSUBR_REST(typ);
 #if 0
-  SCM_ASSERT(n <= sizeof(v)/sizeof(SCM),
-            self, "internal programming error", FUNC_NAME);
+  if (n > SCM_GSUBR_MAX)
+    scm_misc_error (FUNC_NAME, 
+                   "Function ~S has illegal arity ~S.", 
+                   SCM_LIST2 (self, SCM_MAKINUM (n)));
 #endif
   args = SCM_CDR(args);
   for (i = 0; i < SCM_GSUBR_REQ(typ); i++) {
 #ifndef SCM_RECKLESS
-    if (SCM_IMP(args))
-      wnargs: scm_wrong_num_args (SCM_SNAME(SCM_GSUBR_PROC(self)));
+    if (SCM_NULLP (args))
+      scm_wrong_num_args (SCM_SNAME (SCM_GSUBR_PROC (self)));
 #endif
     v[i] = SCM_CAR(args);
     args = SCM_CDR(args);
@@ -161,8 +163,8 @@
   }
   if (SCM_GSUBR_REST(typ))
     v[i] = args;
-  else
-    SCM_ASRTGO(SCM_NULLP(args), wnargs);
+  else if (!SCM_NULLP (args))
+    scm_wrong_num_args (SCM_SNAME (SCM_GSUBR_PROC (self)));
   switch (n) {
   case 2: return (*fcn)(v[0], v[1]);
   case 3: return (*fcn)(v[0], v[1], v[2]);
@@ -176,6 +178,7 @@
   }
   return SCM_BOOL_F; /* Never reached. */
 }
+#undef FUNC_NAME
 
 
 #ifdef GSUBR_TEST
@@ -203,8 +206,6 @@
 void
 scm_init_gsubr()
 {
-  /* GJB:FIXME:MD: Use scm_make_subr_opt instead -- gsubr-apply should not be a
-     published primitive available at the Scheme level */
   scm_f_gsubr_apply = scm_make_subr_opt("gsubr-apply", scm_tc7_lsubr, 
scm_gsubr_apply, 0);
   scm_sym_name = SCM_CAR (scm_sysintern ("name", SCM_UNDEFINED));
   scm_permanent_object (scm_sym_name);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]