summaryrefslogtreecommitdiffstats
path: root/tests/010/hash.tl
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-03-02 21:10:36 -0800
committerKaz Kylheku <kaz@kylheku.com>2022-03-02 21:10:36 -0800
commit782873797401693035c47040f43bdb82630c45fa (patch)
tree897c38804bfd84519f228fa4a8258f8c4b9d0f51 /tests/010/hash.tl
parent9175dc378d5b2a6da0810d17407c3decfa91206a (diff)
downloadtxr-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.tl4
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)