summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-01-15 22:50:25 -0800
committerKaz Kylheku <kaz@kylheku.com>2014-01-15 22:50:25 -0800
commitaba056045000ed165027829eef93d469cc04b35d (patch)
tree2e7d03258d5d62288a4f2f62e1d11559ae81f1d0
parent9ba41588b1282bde4e113406923ec081124cded6 (diff)
downloadtxr-aba056045000ed165027829eef93d469cc04b35d.tar.gz
txr-aba056045000ed165027829eef93d469cc04b35d.tar.bz2
txr-aba056045000ed165027829eef93d469cc04b35d.zip
* lib.c (obj_print, obj_pprint): Convert the internal representation
of @sym and @(expr ...) syntax back to these notations instead of leaving them as (sys:var sym) and (sys:expr expr ...).
-rw-r--r--ChangeLog6
-rw-r--r--lib.c12
2 files changed, 18 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 378961d5..94760add 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2014-01-15 Kaz Kylheku <kaz@kylheku.com>
+ * lib.c (obj_print, obj_pprint): Convert the internal representation
+ of @sym and @(expr ...) syntax back to these notations instead
+ of leaving them as (sys:var sym) and (sys:expr expr ...).
+
+2014-01-15 Kaz Kylheku <kaz@kylheku.com>
+
* eval.c (append_each_s, append_each_star_s): New symbol variables.
(op_each, expand): Support append-each and append-each*.
(eval_init): Initialize new symbol variables, and register
diff --git a/lib.c b/lib.c
index 2f5264d7..683b8e3d 100644
--- a/lib.c
+++ b/lib.c
@@ -4823,6 +4823,12 @@ val obj_print(val obj, val out)
} else if (sym == splice_s) {
put_string(lit(",*"), out);
obj_print(second(obj), out);
+ } else if (sym == var_s && symbolp(second(obj))) {
+ put_char(chr('@'), out);
+ obj_print(second(obj), out);
+ } else if (sym == expr_s) {
+ put_char(chr('@'), out);
+ obj_print(rest(obj), out);
} else {
val iter;
val closepar = chr(')');
@@ -4982,6 +4988,12 @@ val obj_pprint(val obj, val out)
} else if (sym == splice_s) {
put_string(lit(",*"), out);
obj_pprint(second(obj), out);
+ } else if (sym == var_s && symbolp(second(obj))) {
+ put_char(chr('@'), out);
+ obj_print(second(obj), out);
+ } else if (sym == expr_s) {
+ put_char(chr('@'), out);
+ obj_print(rest(obj), out);
} else {
val iter;
val closepar = chr(')');