summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-11-25 22:44:51 -0800
committerKaz Kylheku <kaz@kylheku.com>2018-11-25 22:44:51 -0800
commit0ab82ff2e1a08dae8b93ed2727286c9c14c87446 (patch)
tree01ba43429e0fba74d9622bc1a5d6bbea83e7458a
parent103b321f5c15f1bd971ea5796fbd6876746abdad (diff)
downloadtxr-0ab82ff2e1a08dae8b93ed2727286c9c14c87446.tar.gz
txr-0ab82ff2e1a08dae8b93ed2727286c9c14c87446.tar.bz2
txr-0ab82ff2e1a08dae8b93ed2727286c9c14c87446.zip
print: keep colon in keyword syms
* lib.c (obj_print_impl): Always include leading colon when printing keyword symbols, regardless of pretty flag. Subject to backward compatibility. * txr.1: Compat note added.
-rw-r--r--lib.c6
-rw-r--r--txr.110
2 files changed, 14 insertions, 2 deletions
diff --git a/lib.c b/lib.c
index 3b9262b1..5a4eb3ad 100644
--- a/lib.c
+++ b/lib.c
@@ -11283,7 +11283,11 @@ dot:
}
break;
case SYM:
- if (!pretty) {
+ if (pretty) {
+ if (!opt_compat || opt_compat > 202)
+ if (obj->s.package == keyword_package)
+ put_char(chr(':'), out);
+ } else {
if (!obj->s.package) {
put_string(lit("#:"), out);
} else if (obj->s.package == keyword_package) {
diff --git a/txr.1 b/txr.1
index 11f7ca4f..60220d3d 100644
--- a/txr.1
+++ b/txr.1
@@ -65505,7 +65505,15 @@ Up to \*(TX 202, the
function was incorrectly implemented, producing wrong results when both
arguments are the same fixnum integer, or the same bignum object.
The incorrect behavior is restored if 202 or earlier compatibility is
-requested.
+requested. After 202, the behavior of the
+.code print
+function changed with regard to symbols in the keyword package.
+Regardless of the
+.meta pretty-p
+flag, keywords are printed with the leading colon. Compatibility with
+202 or earlier restores the behavior that when the
+.meta pretty-p
+flag is true, symbols are printed without package prefixes.
.IP 199
After \*(TX 199, certain global variables that had been deprecated
for a long time, and no longer documented, were removed. Requesting 199 or