diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-02-11 01:21:17 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-02-11 01:21:17 -0800 |
commit | a32e4c21286764c013950015108d745fbdcd97ae (patch) | |
tree | 69f35b4dd96b0cf2d99fdcea6068ef13969ec411 /hash.c | |
parent | 1e90ef3c7658e2770940f6cb870bb671733cc188 (diff) | |
download | txr-a32e4c21286764c013950015108d745fbdcd97ae.tar.gz txr-a32e4c21286764c013950015108d745fbdcd97ae.tar.bz2 txr-a32e4c21286764c013950015108d745fbdcd97ae.zip |
* combi.c (comb_hash_while_fun, comb_hash_gen_fun, comb_hash): New
static functions.
(comb): Support hash tables.
* hash.c (print_key_val): When values are nil, print in a more condensed
way by omitting the second element. This notation is accepted as
input already by the parser.
(hash_insert_pair): New function.
* txr.1: Description of comb updated to indicate that it works over
hashes.
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -230,7 +230,10 @@ cnum cobj_hash_op(val obj) static val print_key_val(val out, val key, val value) { - format(out, lit(" (~s ~s)"), key, value, nao); + if (value) + format(out, lit(" (~s ~s)"), key, value, nao); + else + format(out, lit(" (~s)"), key, nao); return nil; } |