plus function, indentation
This commit is contained in:
parent
21b0702154
commit
8560f15c87
@ -8,7 +8,6 @@ module Register
|
||||
plus_function.source.return_type = Virtual::Integer
|
||||
plus_function.source.receiver = Virtual::Integer
|
||||
plus_function.source.add_code Register::OperatorInstruction.new( plus_function, :add , 0 , 0 )
|
||||
|
||||
return plus_function
|
||||
end
|
||||
# The conversion to base10 is quite a bit more complicated than i thought.
|
||||
|
@ -160,8 +160,6 @@ module Virtual
|
||||
[:putint,:fibo , :plus].each do |f|
|
||||
obj.add_instance_method Register::Builtin::Integer.send(f , nil)
|
||||
end
|
||||
# obj.alias :plus , :+
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -32,9 +32,10 @@ module Virtual
|
||||
raise "Method not implemented #{me.class}.#{code.name}" unless method
|
||||
new_codes << MethodCall.new( method )
|
||||
elsif( me.is_a? Fixnum )
|
||||
# get the function from my class. easy peasy
|
||||
method = Virtual.machine.space.get_class_by_name(:Integer).get_instance_method(code.name)
|
||||
raise "Method not implemented #{me.class}.#{code.name}" unless method
|
||||
name = code.name
|
||||
name = :plus if name == :+
|
||||
method = Virtual.machine.space.get_class_by_name(:Integer).get_instance_method(name)
|
||||
raise "Method not implemented Integer.#{name}" unless method
|
||||
new_codes << MethodCall.new( method )
|
||||
else
|
||||
# note: this is the current view: call internal send, even the method name says else
|
||||
|
Loading…
Reference in New Issue
Block a user