Here are some things I've noticed.  I don't know what to make of them,
but, I wanted to jot them down before I forgot them.

1. When compiled with -DSCM_DEBUG, build fails because of invalid lvalue
assignment in programs.c.  Easy fix.  See attached patches to
program.[ch].

2. When compiled with -DSCM_DEBUG, the "fraction generics" test in
fractions.test fails with a "Non-pair accessed with SCM_C[AD]R:
`#<program 91ad670 (class . initargs)>'"

3. Likewise, the "interaction with `struct-ref'" in goops.test fails
with "Non-pair accessed with SCM_C[AD]R: `#<program 90570b0 (class .
initargs)>'"

4. Similar in goops.test for "interaction with `struct-set!",
"overwriting a top-level binding to a generic" and others

diff --git a/libguile/programs.c b/libguile/programs.c
index 8e89829..cb5cbba 100644
--- a/libguile/programs.c
+++ b/libguile/programs.c
@@ -340,7 +340,7 @@ SCM_DEFINE (scm_program_external_set_x, 
"program-external-set!", 2, 0, 0,
 {
   SCM_VALIDATE_PROGRAM (1, program);
   SCM_VALIDATE_LIST (2, external);
-  SCM_PROGRAM_EXTERNALS (program) = external;
+  SCM_SET_PROGRAM_EXTERNALS (program,external);
   return SCM_UNSPECIFIED;
 }
 #undef FUNC_NAME
diff --git a/libguile/programs.h b/libguile/programs.h
index 68a6936..6255cb9 100644
--- a/libguile/programs.h
+++ b/libguile/programs.h
@@ -59,6 +59,7 @@ extern scm_t_bits scm_tc16_program;
 #define SCM_PROGRAM_OBJCODE(x) (SCM_SMOB_OBJECT (x))
 #define SCM_PROGRAM_OBJTABLE(x)        (SCM_SMOB_OBJECT_2 (x))
 #define SCM_PROGRAM_EXTERNALS(x) (SCM_SMOB_OBJECT_3 (x))
+#define SCM_SET_PROGRAM_EXTERNALS(x,obj) (SCM_SET_SMOB_OBJECT_3 (x,obj))
 #define SCM_PROGRAM_DATA(x)    (SCM_OBJCODE_DATA (SCM_PROGRAM_OBJCODE (x)))
 #define SCM_VALIDATE_PROGRAM(p,x) SCM_MAKE_VALIDATE (p, x, PROGRAM_P)
 #define SCM_PROGRAM_IS_BOOT(x) (SCM_SMOB_FLAGS (x) & SCM_F_PROGRAM_IS_BOOT)

Reply via email to