Created
April 25, 2025 09:05
-
-
Save MarioAriasC/48368502af30a994844ae229ea1a96f8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
fun eval(program: Program, env: Environment): MObject? { | |
var result: MObject? = null | |
for (statement in program.statements) { | |
result = eval(statement, env) | |
when (result) { | |
is MReturnValue -> return result.value | |
is MError -> return result | |
} | |
} | |
return result | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment