Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Interpreter 1: No Scope (excerpt)
def substitute(exp, name, value):
if exp == name:
return value
elif isinstance(exp, tuple):
return tuple([substitute(part, name, value) for part in exp])
else:
return exp #Unchanged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.