From a32e4c21286764c013950015108d745fbdcd97ae Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 11 Feb 2014 01:21:17 -0800 Subject: * 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. --- txr.1 | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'txr.1') diff --git a/txr.1 b/txr.1 index f7b65d7d..2d7f5274 100644 --- a/txr.1 +++ b/txr.1 @@ -7957,18 +7957,20 @@ length non-repeating combinations formed by taking items taken from element of more than once. If contains no duplicates, then the combinations contain no duplicates. -Argument must be a nonnegative integer, and must be a sequence. +Argument must be a nonnegative integer, and must be a sequence +or a hash table. -The combinations in the returned list are sequences of the same kind as . +The combinations in the returned list are objects of the same kind as . If is zero, then a list containing one combination is returned, and that permutations is of zero length. -If exceeds the length of , then an empty list is returned, -since it is impossible to make a single non-repeating combination that -requires more items than are available. +If exceeds the number of elements in , then an empty list is +returned, since it is impossible to make a single non-repeating combination +that requires more items than are available. -The combinations are lexicographically ordered. +If is a sequence, the returned combinations are lexicographically ordered. +This requirement is not applicable when is a hash table. .SS Function rcomb -- cgit v1.2.3