summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);