summaryrefslogtreecommitdiffstats
path: root/lib.c
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 /lib.c
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 'lib.c')
-rw-r--r--lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib.c b/lib.c
index 745714f9..2771c18d 100644
--- a/lib.c
+++ b/lib.c
@@ -4092,7 +4092,7 @@ val gensym(val prefix)
{
prefix = default_arg(prefix, lit("g"));
loc gs_loc = lookup_var_l(nil, gensym_counter_s);
- val name = format(nil, lit("~a~,04a"), prefix,
+ val name = format(nil, lit("~a~,04d"), prefix,
set(gs_loc, plus(deref(gs_loc), one)), nao);
return make_sym(name);
}