diff options
author | Marius Vollmer <mvo@zagadka.de> | 2001-07-26 21:40:18 +0000 |
---|---|---|
committer | Marius Vollmer <mvo@zagadka.de> | 2001-07-26 21:40:18 +0000 |
commit | 904a077df1a670d386ca114ddb7a8e371684f655 (patch) | |
tree | 62ba0cc7b9226c16c662cf884cb2b6c440529df4 /libguile/print.c | |
parent | 5b54c4daa124b0d9f9b984f0bf1733ac5ebba4d3 (diff) | |
download | guile-904a077df1a670d386ca114ddb7a8e371684f655.tar.gz |
* tags.h: Update tag system docs.
(scm_tc3_cons_gloc): Renamed to scm_tc3_struct. Changed all uses.
(scm_tcs_cons_gloc): Renamed to scm_tcs_struct. Changed all uses.
(SCM_ECONSP, SCM_NECONSP): Removed. Changed all uses to SCM_CONSP
or SCM_NCONSP, respectively.
* struct.c, struct.h, srcprop.c, procs.c, procprop.c, print.c,
objects.c. modules.c, goops.c, eval.c, debug.c: Changed all uses
of scm_tc3_cond_gloc and scm_tcs_cons_gloc. See above.
* print.c (scm_iprin1): Remove printing of glocs. Do not try to
tell glocs from structs.
* gc.c (scm_gc_mark, scm_gc_sweep): Remove handling of glocs.
* eval.c (scm_m_atbind): Make a list of variables, not glocs.
(scm_ceval, scm_deval): For SCM_IM_BIND, fiddle with variables
instead of with glocs.
(EVALCAR): Do not test for glocs.
(scm_lookupcar, scm_lookupcar1): Do not handle glocs in race
condition.
(scm_unmemocar): Do not handle glocs.
(scm_m_atfop): Memoize as a variable, not as a gloc.
(scm_eval_args, scm_deval_args): Do not handle glocs.
(scm_ceval, scm_deval): Likewise.
* eval.h (SCM_XEVALCAR): Do not test for glocs.
(SCM_GLOC_VAR, SCM_GLOC_VAL, SCM_GLOC_SET_VAL, SCM_GLOC_VAL_LOC):
Removed.
* debug.h, debug.c (scm_make_gloc, scm_gloc_p): Removed.
* dynwind.c (scm_swap_bindings): Likewise.
(scm_dowinds): Updated to recognize lists of variables instead of
lists of glocs.
* __scm.h (SCM_CAUTIOS, SCM_RECKLESS): Update comments.
Diffstat (limited to 'libguile/print.c')
-rw-r--r-- | libguile/print.c | 64 |
1 files changed, 26 insertions, 38 deletions
diff --git a/libguile/print.c b/libguile/print.c index 3873da422..6204a8738 100644 --- a/libguile/print.c +++ b/libguile/print.c @@ -397,7 +397,6 @@ SCM_GPROC(s_display, "display", 1, 1, 0, scm_display, g_display); void scm_iprin1 (SCM exp, SCM port, scm_print_state *pstate) { -taloop: switch (SCM_ITAG3 (exp)) { case scm_tc3_closure: @@ -451,39 +450,30 @@ taloop: scm_ipruk ("immediate", exp, port); } break; - case scm_tc3_cons_gloc: - /* gloc */ - scm_puts ("#@", port); - exp = scm_module_reverse_lookup (scm_current_module (), - SCM_GLOC_VAR (exp)); - goto taloop; case scm_tc3_cons: switch (SCM_TYP7 (exp)) { - case scm_tcs_cons_gloc: - - if (SCM_STRUCT_VTABLE_DATA (exp) [scm_vtable_index_vcell] == 0) - { - ENTER_NESTED_DATA (pstate, exp, circref); - if (SCM_OBJ_CLASS_FLAGS (exp) & SCM_CLASSF_GOOPS) - { - SCM pwps, print = pstate->writingp ? g_write : g_display; - if (!print) - goto print_struct; - SCM_NEWSMOB (pwps, - scm_tc16_port_with_ps, - SCM_UNPACK (scm_cons (port, pstate->handle))); - scm_call_generic_2 (print, exp, pwps); - } - else - { - print_struct: - scm_print_struct (exp, port, pstate); - } - EXIT_NESTED_DATA (pstate); - break; - } - + case scm_tcs_struct: + { + ENTER_NESTED_DATA (pstate, exp, circref); + if (SCM_OBJ_CLASS_FLAGS (exp) & SCM_CLASSF_GOOPS) + { + SCM pwps, print = pstate->writingp ? g_write : g_display; + if (!print) + goto print_struct; + SCM_NEWSMOB (pwps, + scm_tc16_port_with_ps, + SCM_UNPACK (scm_cons (port, pstate->handle))); + scm_call_generic_2 (print, exp, pwps); + } + else + { + print_struct: + scm_print_struct (exp, port, pstate); + } + EXIT_NESTED_DATA (pstate); + } + break; case scm_tcs_cons_imcar: case scm_tcs_cons_nimcar: ENTER_NESTED_DATA (pstate, exp, circref); @@ -754,9 +744,7 @@ scm_ipruk (char *hdr, SCM ptr, SCM port) } -/* Print a list. The list may be either a list of ordinary data, or it may be - a list that represents code. Lists that represent code may contain gloc - cells. +/* Print a list. */ void scm_iprlist (char *hdr,SCM exp,int tlr,SCM port,scm_print_state *pstate) @@ -772,12 +760,12 @@ scm_iprlist (char *hdr,SCM exp,int tlr,SCM port,scm_print_state *pstate) O(depth * N) instead of O(N^2). */ hare = SCM_CDR (exp); tortoise = exp; - while (SCM_ECONSP (hare)) + while (SCM_CONSP (hare)) { if (SCM_EQ_P (hare, tortoise)) goto fancy_printing; hare = SCM_CDR (hare); - if (SCM_IMP (hare) || SCM_NECONSP (hare)) + if (SCM_IMP (hare) || SCM_NCONSP (hare)) break; hare = SCM_CDR (hare); tortoise = SCM_CDR (tortoise); @@ -785,7 +773,7 @@ scm_iprlist (char *hdr,SCM exp,int tlr,SCM port,scm_print_state *pstate) /* No cdr cycles intrinsic to this list */ scm_iprin1 (SCM_CAR (exp), port, pstate); - for (exp = SCM_CDR (exp); SCM_ECONSP (exp); exp = SCM_CDR (exp)) + for (exp = SCM_CDR (exp); SCM_CONSP (exp); exp = SCM_CDR (exp)) { register long i; @@ -814,7 +802,7 @@ fancy_printing: scm_iprin1 (SCM_CAR (exp), port, pstate); exp = SCM_CDR (exp); --n; - for (; SCM_ECONSP (exp); exp = SCM_CDR (exp)) + for (; SCM_CONSP (exp); exp = SCM_CDR (exp)) { register unsigned long i; |