diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2018-11-25 22:44:51 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2018-11-25 22:44:51 -0800 |
commit | f057a56f9dc8e2a4ad77ecf26f6cf114812bf389 (patch) | |
tree | 01ba43429e0fba74d9622bc1a5d6bbea83e7458a | |
parent | 04947ade734e0787d30c15da004a2a1d71a59402 (diff) | |
download | txr-f057a56f9dc8e2a4ad77ecf26f6cf114812bf389.tar.gz txr-f057a56f9dc8e2a4ad77ecf26f6cf114812bf389.tar.bz2 txr-f057a56f9dc8e2a4ad77ecf26f6cf114812bf389.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.c | 6 | ||||
-rw-r--r-- | txr.1 | 10 |
2 files changed, 14 insertions, 2 deletions
@@ -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) { @@ -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 |