summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Djurfeldt <djurfeldt@nada.kth.se>1997-10-02 17:52:03 +0000
committerMikael Djurfeldt <djurfeldt@nada.kth.se>1997-10-02 17:52:03 +0000
commitba031394ecebf4f8c177b61fb0110ab9c905a27c (patch)
tree6df678ebf1397d54e3ee3ab0cd13c45e3143cbd1
parent20cb8b8c4fd06728cc5c1b5e78f4f4172d21095e (diff)
downloadguile-ba031394ecebf4f8c177b61fb0110ab9c905a27c.tar.gz
* print.c (scm_iprin1): Don't print arguments of macro
transformers. (They are always: exp env.); Bugfix: Unmemoize transformer source with correct environment.
-rw-r--r--libguile/ChangeLog6
-rw-r--r--libguile/print.c35
2 files changed, 28 insertions, 13 deletions
diff --git a/libguile/ChangeLog b/libguile/ChangeLog
index 93a78fff2..1e30841a6 100644
--- a/libguile/ChangeLog
+++ b/libguile/ChangeLog
@@ -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>
Streamlining of call-with-dynamic-root:
diff --git a/libguile/print.c b/libguile/print.c
index c27250486..90411b371 100644
--- a/libguile/print.c
+++ b/libguile/print.c
@@ -348,7 +348,7 @@ taloop:
|| SCM_FALSEP (scm_printer_apply (SCM_PRINT_CLOSURE,
exp, port, pstate)));
{
- SCM name, code;
+ SCM name, code, env;
if (SCM_TYP16 (exp) == scm_tc16_macro)
{
/* Printing a macro. */
@@ -363,6 +363,7 @@ taloop:
else
{
code = SCM_CODE (SCM_CDR (exp));
+ env = SCM_ENV (SCM_CDR (exp));
scm_gen_puts (scm_regular_string, "#<", port);
}
if (SCM_CAR (exp) & (3L << 16))
@@ -377,6 +378,7 @@ taloop:
/* Printing a closure. */
name = scm_procedure_name (exp);
code = SCM_CODE (exp);
+ env = SCM_ENV (exp);
scm_gen_puts (scm_regular_string, "#<procedure",
port);
}
@@ -387,18 +389,25 @@ taloop:
}
if (code)
{
- scm_gen_putc (' ', port);
- scm_iprin1 (SCM_CAR (code), port, pstate);
- }
- if (code && SCM_PRINT_SOURCE_P)
- {
- code = scm_unmemocopy (SCM_CDR (code),
- SCM_EXTEND_ENV (SCM_CAR (code),
- SCM_EOL,
- SCM_ENV (exp)));
- ENTER_NESTED_DATA (pstate, exp, circref);
- scm_iprlist (" ", code, '>', port, pstate);
- EXIT_NESTED_DATA (pstate);
+ if (SCM_PRINT_SOURCE_P)
+ {
+ code = scm_unmemocopy (code,
+ SCM_EXTEND_ENV (SCM_CAR (code),
+ SCM_EOL,
+ env));
+ ENTER_NESTED_DATA (pstate, exp, circref);
+ scm_iprlist (" ", code, '>', port, 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
scm_gen_putc ('>', port);