Class: NativeFn
Instance Attribute Summary
Attributes inherited from DataType
Instance Method Summary collapse
-
#initialize(arity, val) ⇒ NativeFn
constructor
A new instance of NativeFn.
Constructor Details
#initialize(arity, val) ⇒ NativeFn
Returns a new instance of NativeFn.
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/sdx/vm/datatypes.rb', line 34 def initialize(arity, val) @internal = val @fields = { "__call" => (NativeFnInternal.new (lambda do |args, scope| args.reverse! @internal.call *args end)), "__arity" => (Int.new arity) } end |