Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def find_new_bindings(bindings, e1, e2):
- e1 = normalize(bindings, e1)
- progress = false
- if e1 is Var:
- bindings.add(e1, e2)
- return true
- if (e1 is Apply) and (e2 is Apply):
- progress |= find_new_bindings(bindings, e1.head, e2.head)
- progress |= find_new_bindings(bindings, e1.arg, e2.arg)
- return progress
- if (e1 is Multiname) and (e2 is Multiname):
- if not intersects(e1, e2):
- error "doesnt match"
- return false
- def normalize(bindings, e):
- if e in bindings:
- return bindings[e]
- return e
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement