summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-11-13 20:54:48 -0800
committerKaz Kylheku <kaz@kylheku.com>2015-11-14 08:37:26 -0800
commitea8bf1c897290d2283033d8e3546a970cdd096f3 (patch)
tree45020f16bcceec996d9d5b5608f02143394ef4bc /txr.1
parent9f633256dea9a141bc5a4d96b2b9c47e3ecb4858 (diff)
downloadtxr-ea8bf1c897290d2283033d8e3546a970cdd096f3.tar.gz
txr-ea8bf1c897290d2283033d8e3546a970cdd096f3.tar.bz2
txr-ea8bf1c897290d2283033d8e3546a970cdd096f3.zip
Implementing *print-base* and ~d format directive.
* debug.c (show_bindings): Use ~d for level, so as not to be influenced by *print-base*. (debug): Use ~d for line numbers. * lib.c (gensym): Use ~d conversion specifier for formatting gensym counter into symbol name. * match.c (LOG_MISMATCH, LOG_MATCH): Use ~d for line number references. (h_skip, h_coll, h_fun, h_chr, match_line_completely, v_skip, v_fuzz, v_gather, v_collect, v_output, v_filter, v_fun, v_assert, v_load, v_line, h_assert, open_data_source): Use ~d for line refs, number of iterations, errno values. * parser.c (repl): Use ~d for prompt line numbers, numbered variables and the expr-<n> string in error messages. * parser.l (yyerrorf, source_loc_str): Use ~d for line numbers. * stream.c (print_base_s): New symbol variable. (formatv): Implement *print-base*. (stdio_maybe_read_error, stdio_maybe_error, stdio_close, pipe_close, open_directory, open_file, open_fileno, open_tail, open_process, run, remove_path): Use ~d for errno values. (stream_init): Initialize print_base_s and register *print-base* special variable. sysif.c (mkdir_wrap, ensure_dir, getcwd_wrap, mknod_wrap, chmod_wrap, symlink_wrap, link_wrap, readlink_wrap, excec_wrap, stat_impl, pipe_wrap, poll_wrap, getgroups_wrap, setuid_wrap, seteuid_wrap, setgid_wrap): Use ~d for errno values and system function results. * txr.1: Documented *print-base* and ~d conversion specifier.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.150
1 files changed, 49 insertions, 1 deletions
diff --git a/txr.1 b/txr.1
index 79fa9520..13940ef2 100644
--- a/txr.1
+++ b/txr.1
@@ -30798,6 +30798,41 @@ to the value of the
.code flo-max-dig
variable.
+.coNP Special variable @ *print-base*
+.desc
+The
+.code *print-base*
+variable controls the base (radix) used for printing integer values.
+It applies when the functions
+.codn print ,
+.cond pprint ,
+.cond prinl ,
+.cond pprinl ,
+.code tostring
+and
+.codn tostringp
+process an integer value.
+It also applies when the
+.code ~a
+and
+.code ~s
+conversion specifiers of the
+.code format
+function are used for printing an integer value.
+
+The default value of the variable is
+.codn 10 .
+
+Meaningful values are:
+.codn 2 ,
+.codn 8 ,
+.code 10
+and
+.codn 16 .
+
+When base 16 is selected, hexadecimal digits are printed as upper-case
+characters.
+
.coNP Function @ format
.synb
.mets (format < stream-designator < format-string << format-arg *)
@@ -31044,7 +31079,20 @@ for the sake of read-print
consistency. Objects truncated by precision may not have read-print
consistency. For instance, if a string object is truncated, it loses its
trailing closing quote, so that the resulting representation is no longer
-a properly formed string object.
+a properly formed string object. For integer objects, the
+.code *print-base*
+variable is honored. Effectively, an integer is printed by the
+.code s
+directive as if by the
+.codn b ,
+.codn o ,
+.codn d ,
+or
+.code x directive, depending on the value of the variable.
+
+.coIP d
+Requires an argument of integer or character type type. The integer
+value or character code is printed in decimal.
.coIP x
Requires an argument of character or integer type. The integer value or