lib/nydp/builtin.rb in nydp-0.1.9.1 vs lib/nydp/builtin.rb in nydp-0.1.10

- old
+ new

@@ -3,19 +3,36 @@ module Nydp::Builtin module Base include Nydp::Helper + def builtin_invoke_1 vm ; builtin_invoke vm, Nydp.NIL ; end + def builtin_invoke_2 vm, a ; builtin_invoke vm, cons(a) ; end + def builtin_invoke_3 vm, a0, a1 ; builtin_invoke vm, cons(a0, cons(a1)) ; end + def builtin_invoke_4 vm, a0, a1, a2 ; builtin_invoke vm, cons(a0, cons(a1, cons(a2))) ; end + def invoke_1 vm - invoke vm, Nydp.NIL + builtin_invoke_1 vm + rescue Exception => e + handle_error e, Nydp.NIL end def invoke_2 vm, arg - invoke vm, cons(arg) + builtin_invoke_2 vm, arg + rescue Exception => e + handle_error e, cons(arg) end def invoke_3 vm, arg_0, arg_1 - invoke vm, cons(arg_0, cons(arg_1)) + builtin_invoke_3 vm, arg_0, arg_1 + rescue Exception => e + handle_error e, cons(arg_0, cons(arg_1)) + end + + def invoke_4 vm, arg_0, arg_1, arg_2 + builtin_invoke_4 vm, arg_0, arg_1, arg_2 + rescue Exception => e + handle_error e, cons(arg_0, cons(arg_1, cons(arg_2))) end def invoke vm, args builtin_invoke vm, args rescue Exception => e