Open cespare opened 8 years ago
Another idea:
There may be non-semantic nodes present, so a caller can't just iterate through every pair of m.Children()
.
Maybe this is implemented as:
type KeyVal struct {
Key Node
Val Node
}
func (m *MapNode) KeyVals() []*KeyVal
Or you could have an iterator, which might be more efficient if you're only looking for one key, say:
kv := m.KeyVals()
for kv.Next() {
key, val := kv.KeyVal()
}
Some common tasks:
It would be nice to have some clever high-level API for searching/matching certain constructs.