Commit Graph

2 Commits

Author SHA1 Message Date
c738c52455 Add Method type for objects
* Methods are wrappers created with an owner and a function, which
  passes the owner as the first argument when the function is called.
* Fix a small bug in the VM where the pc was being set at the wrong
  time

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-10-08 16:10:10 -07:00
16063d50f8 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>
2020-10-07 17:21:01 -07:00