eachKey calls fn with each key of a map. Values which are not maps have no keys.
(val ref.Val, fn func(ref.Val))
| 173 | |
| 174 | // eachKey calls fn with each key of a map. Values which are not maps have no keys. |
| 175 | func eachKey(val ref.Val, fn func(ref.Val)) { |
| 176 | if m, ok := val.(traits.Mapper); ok { |
| 177 | for it := m.Iterator(); it.HasNext() == types.True; { |
| 178 | fn(it.Next()) |
| 179 | } |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | // constExpr represents a constant integer quantity. |
| 184 | type constExpr struct { |