diff options
Diffstat (limited to 'src/LispExecutionContext.kt')
-rw-r--r-- | src/LispExecutionContext.kt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/LispExecutionContext.kt b/src/LispExecutionContext.kt index ba7df41..f85cc4b 100644 --- a/src/LispExecutionContext.kt +++ b/src/LispExecutionContext.kt @@ -3,7 +3,7 @@ package moe.nea.lisp class LispExecutionContext() { private val errorReporter = LispErrorReporter() - private val rootStackFrame = StackFrame(null) + val rootStackFrame = StackFrame(null) fun reportError(name: String, position: HasLispPosition): LispData.LispNil { @@ -16,6 +16,11 @@ class LispExecutionContext() { return StackFrame(rootStackFrame) } + fun setupStandardBindings() { + CoreBindings.offerAllTo(rootStackFrame) + Builtins.loadBuiltins(this, rootStackFrame::setValueLocal) + } + fun executeProgram(stackFrame: StackFrame, program: LispAst.Program): LispData? { var lastValue: LispData? = null for (node in program.nodes) { |