diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-03-02 21:10:36 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-03-02 21:10:36 -0800 |
commit | 782873797401693035c47040f43bdb82630c45fa (patch) | |
tree | 897c38804bfd84519f228fa4a8258f8c4b9d0f51 /tests/010/hash.tl | |
parent | 9175dc378d5b2a6da0810d17407c3decfa91206a (diff) | |
download | txr-782873797401693035c47040f43bdb82630c45fa.tar.gz txr-782873797401693035c47040f43bdb82630c45fa.tar.bz2 txr-782873797401693035c47040f43bdb82630c45fa.zip |
New function: group-map.
* hash.c (group_map): New function.
(hash_init): group-map intrinsic registered.
* hash.h (group_map): Declared.
* tests/010/hash.tl: New test case.
* txr.1: Documented together with group-by.
Extra paren removed from group-by example.
Diffstat (limited to 'tests/010/hash.tl')
-rw-r--r-- | tests/010/hash.tl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/010/hash.tl b/tests/010/hash.tl index bb006612..7f662b51 100644 --- a/tests/010/hash.tl +++ b/tests/010/hash.tl @@ -9,8 +9,8 @@ [group-by identity '(1 1 2 2 3 3 3)] #H(() (1 (1 1)) (2 (2 2)) (3 (3 3 3))) (group-by (op mod @1 3) (range 0 10)) #H(() (0 (0 3 6 9)) (1 (1 4 7 10)) - (2 (2 5 8)))) - + (2 (2 5 8))) + [group-map (op mod @1 3) sum (range 0 10)] #H(() (0 18) (1 22) (2 15))) (mtest [group-reduce (hash) identity (do inc @1) |