summaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index 010cfbf6..618acc75 100644
--- a/hash.c
+++ b/hash.c
@@ -395,6 +395,15 @@ val hash_next(val *iter)
return car(hi->cons);
}
+val maphash(val fun, val hash)
+{
+ val iter = hash_begin(hash);
+ val cell;
+ while ((cell = hash_next(&iter)) != nil)
+ funcall2(fun, car(cell), cdr(cell));
+ return nil;
+}
+
/*
* Called from garbage collector. Hash module must process all weak tables
* that were visited during the marking phase, maintained in the list