aboutsummaryrefslogtreecommitdiff
path: root/src/map.hff
diff options
context:
space:
mode:
Diffstat (limited to 'src/map.hff')
-rw-r--r--src/map.hff12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/map.hff b/src/map.hff
index 700c553..c756d88 100644
--- a/src/map.hff
+++ b/src/map.hff
@@ -112,3 +112,15 @@ struct Map<K, V, KTraits> {
}
}
+
+defmacro map_each(v, k, map, &body) [
+ let $m = (map);
+ for let $i = 0; $i < $m.N; ++$i {
+ if $m->_iempty($i) {
+ continue;
+ }
+ let k = $m.keys[$i];
+ let v = $m.vals[$i];
+ body;
+ }
+]