Last active
August 29, 2015 14:11
-
-
Save SamuraiT/259ac5b2e170f6e42d8f to your computer and use it in GitHub Desktop.
Environment for simple lisp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Env = dict | |
def starndard_env(): | |
import operator as op | |
env = Env() | |
env.update({ | |
'+': op.add, | |
'-': op.sub, | |
'*': op.mul, | |
'/': op.truediv, | |
'>': op.gt, | |
'<':op.lt, | |
'>=': op.ge, | |
'<=': op.le, | |
'=': op.eq, | |
}) | |
return env | |
global_env = starndard_env() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment