1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-03 05:20:16 +02:00

* print.c (scm_iprin1): Don't print arguments of macro

transformers.  (They are always: exp env.); Bugfix: Unmemoize
transformer source with correct environment.
This commit is contained in:
Mikael Djurfeldt 1997-10-02 17:52:03 +00:00
parent 20cb8b8c4f
commit ba031394ec
2 changed files with 28 additions and 13 deletions

View file

@ -1,3 +1,9 @@
Thu Oct 2 19:33:38 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
* print.c (scm_iprin1): Don't print arguments of macro
transformers. (They are always: exp env.); Bugfix: Unmemoize
transformer source with correct environment.
1997-10-02 Marius Vollmer <mvo@zagadka.ping.de> 1997-10-02 Marius Vollmer <mvo@zagadka.ping.de>
Streamlining of call-with-dynamic-root: Streamlining of call-with-dynamic-root:

View file

@ -348,7 +348,7 @@ taloop:
|| SCM_FALSEP (scm_printer_apply (SCM_PRINT_CLOSURE, || SCM_FALSEP (scm_printer_apply (SCM_PRINT_CLOSURE,
exp, port, pstate))); exp, port, pstate)));
{ {
SCM name, code; SCM name, code, env;
if (SCM_TYP16 (exp) == scm_tc16_macro) if (SCM_TYP16 (exp) == scm_tc16_macro)
{ {
/* Printing a macro. */ /* Printing a macro. */
@ -363,6 +363,7 @@ taloop:
else else
{ {
code = SCM_CODE (SCM_CDR (exp)); code = SCM_CODE (SCM_CDR (exp));
env = SCM_ENV (SCM_CDR (exp));
scm_gen_puts (scm_regular_string, "#<", port); scm_gen_puts (scm_regular_string, "#<", port);
} }
if (SCM_CAR (exp) & (3L << 16)) if (SCM_CAR (exp) & (3L << 16))
@ -377,6 +378,7 @@ taloop:
/* Printing a closure. */ /* Printing a closure. */
name = scm_procedure_name (exp); name = scm_procedure_name (exp);
code = SCM_CODE (exp); code = SCM_CODE (exp);
env = SCM_ENV (exp);
scm_gen_puts (scm_regular_string, "#<procedure", scm_gen_puts (scm_regular_string, "#<procedure",
port); port);
} }
@ -387,19 +389,26 @@ taloop:
} }
if (code) if (code)
{ {
scm_gen_putc (' ', port); if (SCM_PRINT_SOURCE_P)
scm_iprin1 (SCM_CAR (code), port, pstate);
}
if (code && SCM_PRINT_SOURCE_P)
{ {
code = scm_unmemocopy (SCM_CDR (code), code = scm_unmemocopy (code,
SCM_EXTEND_ENV (SCM_CAR (code), SCM_EXTEND_ENV (SCM_CAR (code),
SCM_EOL, SCM_EOL,
SCM_ENV (exp))); env));
ENTER_NESTED_DATA (pstate, exp, circref); ENTER_NESTED_DATA (pstate, exp, circref);
scm_iprlist (" ", code, '>', port, pstate); scm_iprlist (" ", code, '>', port, pstate);
EXIT_NESTED_DATA (pstate); EXIT_NESTED_DATA (pstate);
} }
else
{
if (SCM_TYP16 (exp) != scm_tc16_macro)
{
scm_gen_putc (' ', port);
scm_iprin1 (SCM_CAR (code), port, pstate);
}
scm_gen_putc ('>', port);
}
}
else else
scm_gen_putc ('>', port); scm_gen_putc ('>', port);
} }