Add a couple of builtin functions, and the Vm::call() method

* Builtin functions print and println have been added
* If a global lookup fails, the VM will attempt to look up a builtin
* Vm::call(fun, args) allows interrupting the current execution state
  and starting a new function instead. It will return the value left on
  top of the stack.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-10-07 17:21:01 -07:00
parent 76d0e6723f
commit 16063d50f8
6 changed files with 81 additions and 5 deletions

View File

@@ -93,6 +93,10 @@ impl NativeFrame {
&self.fun_ptr
}
pub fn args(&self) -> &Vec<ObjRef> {
&self.args
}
pub fn callee(&self) -> &ObjRef {
&self.callee
}