Class: Lisp::FfiNew
Instance Attribute Summary
Attributes inherited from Atom
#value
Instance Method Summary
collapse
Methods inherited from Atom
#alist?, #all?, #car, #cdr, #character?, #class?, #copy, #doc, #eq?, #evaluate, #false?, #frame?, #function?, #length, #lisp_object?, #list?, #macro?, #negative?, #number?, #object?, #pair?, #positive?, #print_string, #quoted, #set!, #special?, #string?, #symbol?, #true?, #vector?, #zero?
Constructor Details
#initialize(name) ⇒ FfiNew
Returns a new instance of FfiNew.
5
6
7
8
|
# File 'lib/rubylisp/ffi_new.rb', line 5
def initialize(name)
@value = name
@klass = Object.const_get(name)
end
|
Instance Method Details
#apply_to(args, env) ⇒ Object
10
11
12
|
# File 'lib/rubylisp/ffi_new.rb', line 10
def apply_to(args, env)
NativeObject.with_value(@klass.new)
end
|
#apply_to_without_evaluating(args, env) ⇒ Object
14
15
16
|
# File 'lib/rubylisp/ffi_new.rb', line 14
def apply_to_without_evaluating(args, env)
NativeObject.with_value(@klass.new)
end
|
22
23
24
|
# File 'lib/rubylisp/ffi_new.rb', line 22
def primitive?
true
end
|
18
19
20
|
# File 'lib/rubylisp/ffi_new.rb', line 18
def to_s
"#{@value}."
end
|
26
27
28
|
# File 'lib/rubylisp/ffi_new.rb', line 26
def type
:primitive
end
|