Fix T and F builtins to be values, not functions

* T and F were builtins that were created as functions. They have been
  changed to just be global values instead, so you don't need to suffix
  them with ! to get the creamy value inside.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2022-02-11 11:38:43 -08:00
parent 1f642b9739
commit abd7f7960a
2 changed files with 13 additions and 16 deletions

View File

@@ -23,15 +23,9 @@ impl MachineBuilder {
panic!();
});
self.register_builtin_fun("T", |machine, _| {
machine.stack_push(BoolObj::new(true))?;
Ok(BuiltinExit::Return)
});
self.register_builtin_fun("F", |machine, _| {
machine.stack_push(BoolObj::new(false))?;
Ok(BuiltinExit::Return)
});
// True and false values
self.register_global("T", BoolObj::new(true));
self.register_global("F", BoolObj::new(false));
//
// if