diff options
Diffstat (limited to 'std.py')
| -rw-r--r-- | std.py | 26 | 
1 files changed, 13 insertions, 13 deletions
| @@ -16,12 +16,11 @@ def _get_debug():  def std_exit(status=None):      out = 0 if status is None else status.value      sys.exit(out) -    return NebBool(True)  # this should never be reached +    return NebNil()  def std_print(arg):      print(arg.value) -    #return []  # TODO this should return empty list -    return NebBool(True) +    return NebNil()  def std_print_all(arg):      for idx, item in enumerate(arg.items): @@ -31,17 +30,17 @@ def std_print_all(arg):              raise exception("print-all needs all strings!")      for x in arg.items:          std_print(x) -    return NebBool(True) +    return NebNil()  def std_debug_on():      global DEBUG      DEBUG = True -    return NebBool(True) +    return NebNil()  def std_debug_off():      global DEBUG      DEBUG = False -    return NebBool(True) +    return NebNil()  # math  def std_add(arg, rest): @@ -109,7 +108,8 @@ def std_if(cond, t_branch, f_branch=None):              return evaluate_expression(f_branch)          else:              return f_branch -    return NebBool(True) +    #return NebBool(True) +    return NebNil()  # type validation  def std_is_string(arg): @@ -242,19 +242,19 @@ def evaluate_expression(expr):      raise Exception(f"'{expr.symbol.name}' called with unknown signature: '{expr.in_sig()}'")  def build_std(): -    print_string = FuncImpl(NebFunction("print", [NebString], NebString), std_print) +    print_string = FuncImpl(NebFunction("print", [NebString], NebNil), std_print)      STD["print"] = [print_string] -    print_all = FuncImpl(NebFunction("print-all", [NebList], NebBool), std_print_all) +    print_all = FuncImpl(NebFunction("print-all", [NebList], NebNil), std_print_all)      STD["print-all"] = [print_all] -    exit_ = FuncImpl(NebFunction("exit", [], NebBool), std_exit) -    exit_int = FuncImpl(NebFunction("exit", [NebInt], NebBool), std_exit) +    exit_ = FuncImpl(NebFunction("exit", [], NebNil), std_exit) +    exit_int = FuncImpl(NebFunction("exit", [NebInt], NebNil), std_exit)      STD["exit"] = [exit_, exit_int] -    debug_on = FuncImpl(NebFunction("debug-on", [], NebBool), std_debug_on) +    debug_on = FuncImpl(NebFunction("debug-on", [], NebNil), std_debug_on)      STD["debug-on"] = [debug_on] -    debug_off = FuncImpl(NebFunction("debug-off", [], NebBool), std_debug_off) +    debug_off = FuncImpl(NebFunction("debug-off", [], NebNil), std_debug_off)      STD["debug-off"] = [debug_off]      # arithmetic | 
