From dbf5dfb3c1e937b12261a32c47ee3f14ee7e3325 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Wed, 25 Jul 2001 15:28:07 +0000 Subject: * variable.h (scm_tc16_variable): Removed. (SCM_VARIABLEP): Test for new tc7 code. (scm_i_variable_print): New. * variable.c (scm_tc16_variable): Removed. (variable_print): Renamed to scm_i_variable_print and made non-static. (variable_equal_p): Removed. (make_variable): Construct a tc7 object instead of a smob. (scm_init_variable): Do not register smob. --- libguile/variable.c | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'libguile/variable.c') diff --git a/libguile/variable.c b/libguile/variable.c index 4037e51be..9f542eda0 100644 --- a/libguile/variable.c +++ b/libguile/variable.c @@ -52,24 +52,17 @@ #include "libguile/validate.h" #include "libguile/variable.h" -scm_t_bits scm_tc16_variable; -static int -variable_print (SCM exp, SCM port, scm_print_state *pstate) +void +scm_i_variable_print (SCM exp, SCM port, scm_print_state *pstate) { scm_puts ("#', port); - return 1; } -static SCM -variable_equalp (SCM var1, SCM var2) -{ - return scm_equal_p (SCM_VARIABLE_REF (var1), SCM_VARIABLE_REF (var2)); -} #if SCM_ENABLE_VCELLS @@ -80,9 +73,24 @@ static SCM make_variable (SCM init) { #if !SCM_ENABLE_VCELLS - SCM_RETURN_NEWSMOB (scm_tc16_variable, SCM_UNPACK (init)); + { + SCM z; + SCM_NEWCELL (z); + SCM_SET_CELL_WORD_1 (z, SCM_UNPACK (init)); + SCM_SET_CELL_TYPE (z, scm_tc7_variable); + scm_remember_upto_here_1 (init); + return z; + } #else - SCM_RETURN_NEWSMOB (scm_tc16_variable, scm_cons (sym_huh, init)); + { + SCM z; + SCM cell = scm_cons (sym_huh, init); + SCM_NEWCELL (z); + SCM_SET_CELL_WORD_1 (z, SCM_UNPACK (cell)); + SCM_SET_CELL_TYPE (z, scm_tc7_variable); + scm_remember_upto_here_1 (cell); + return z; + } #endif } @@ -192,11 +200,6 @@ SCM_DEFINE (scm_builtin_variable, "builtin-variable", 1, 0, 0, void scm_init_variable () { - scm_tc16_variable = scm_make_smob_type ("variable", 0); - scm_set_smob_mark (scm_tc16_variable, scm_markcdr); - scm_set_smob_print (scm_tc16_variable, variable_print); - scm_set_smob_equalp (scm_tc16_variable, variable_equalp); - #ifndef SCM_MAGIC_SNARFER #include "libguile/variable.x" #endif -- cgit v1.2.3