summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-04-29 19:39:45 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-04-29 19:39:45 -0700
commitd428a0e222590c1eb20c7abdf2905ff0ebddc69a (patch)
tree3ad3f6ccdd72adfce748124e1b5026b96f92d080
parent7a0851c446dc6d128b1c49e21cc9d356bd7debc3 (diff)
downloadtxr-d428a0e222590c1eb20c7abdf2905ff0ebddc69a.tar.gz
txr-d428a0e222590c1eb20c7abdf2905ff0ebddc69a.tar.bz2
txr-d428a0e222590c1eb20c7abdf2905ff0ebddc69a.zip
Bugfix: cannot print (lambda . 42) structure.
* lib.c (obj_print, obj_pprint): Fix mistake in the test for properly formed lambda syntax whcih is printed specially.
-rw-r--r--ChangeLog7
-rw-r--r--lib.c4
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index d7f9edcd..a8e7604e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-04-29 Kaz Kylheku <kaz@kylheku.com>
+
+ Bugfix: cannot print (lambda . 42) structure.
+
+ * lib.c (obj_print, obj_pprint): Fix mistake in the test for
+ properly formed lambda syntax whcih is printed specially.
+
2015-04-28 Kaz Kylheku <kaz@kylheku.com>
Adding poll function.
diff --git a/lib.c b/lib.c
index c4c3edae..611aef91 100644
--- a/lib.c
+++ b/lib.c
@@ -6734,7 +6734,7 @@ val obj_print(val obj, val out)
put_char(chr('('), out);
}
- if (sym == lambda_s && cdr(obj) && symbolp(second(obj))) {
+ if (sym == lambda_s && consp(cdr(obj)) && symbolp(second(obj))) {
obj_print(sym, out);
if (second(obj)) {
put_string(lit(" (. "), out);
@@ -6928,7 +6928,7 @@ val obj_pprint(val obj, val out)
put_char(chr('('), out);
}
- if (sym == lambda_s && cdr(obj) && symbolp(second(obj))) {
+ if (sym == lambda_s && consp(cdr(obj)) && symbolp(second(obj))) {
obj_print(sym, out);
if (second(obj)) {
put_string(lit(" (. "), out);