Class: Nydp::Builtin::HandleError

Inherits:
Object
  • Object
show all
Includes:
Base, Helper, Singleton
Defined in:
lib/nydp/builtin/handle_error.rb

Defined Under Namespace

Classes: CatchError

Instance Method Summary collapse

Methods included from Helper

#cons, #list, #literal?, #pair?, #sig, #sym, #sym?

Methods included from Converter

#n2r, #r2n

Methods included from Base

#builtin_invoke_1, #builtin_invoke_2, #builtin_invoke_3, #builtin_invoke_4, #handle_error, #inspect, #invoke, #invoke_1, #invoke_2, #invoke_3, #invoke_4, #name, #nydp_type, #to_s

Instance Method Details

#builtin_invoke(vm, args) ⇒ Object



37
38
39
40
41
42
43
44
45
# File 'lib/nydp/builtin/handle_error.rb', line 37

def builtin_invoke vm, args
  fn_handle = args.car
  fn_tricky = args.cdr.car

  catcher_instructions = Nydp::Pair.from_list [CatchError.new(fn_handle, vm.args.size)]
  vm.push_ctx_instructions catcher_instructions

  fn_tricky.invoke vm, Nydp::NIL
end