renamed program to boot_space, as in object_space at boot time. thats the way its going
This commit is contained in:
36
lib/core/array.rb
Normal file
36
lib/core/array.rb
Normal file
@ -0,0 +1,36 @@
|
||||
# this is not a "normal" ruby file, ie it is not required by crystal
|
||||
# instead it is parsed by crystal to define part of the crystal that runs
|
||||
|
||||
class BaseObject
|
||||
|
||||
def _set_instance_variable(name , value)
|
||||
|
||||
end
|
||||
|
||||
def _get_instance_variable( name )
|
||||
|
||||
end
|
||||
|
||||
def _get_singleton_method(name )
|
||||
|
||||
end
|
||||
def _add_singleton_method(method)
|
||||
|
||||
end
|
||||
def initialize
|
||||
end
|
||||
end
|
||||
|
||||
class Array < BaseObject
|
||||
def initialize size
|
||||
|
||||
end
|
||||
|
||||
def at(index)
|
||||
|
||||
end
|
||||
|
||||
def set(index , value)
|
||||
|
||||
end
|
||||
end
|
@ -35,10 +35,10 @@ module Core
|
||||
def putint context , arg = Vm::Integer
|
||||
putint_function = Vm::Function.new(:putint , [arg] , arg )
|
||||
buffer = Vm::StringConstant.new(" ") # create a buffer
|
||||
context.program.add_object buffer # and save it (function local variable: a no no)
|
||||
context.object_space.add_object buffer # and save it (function local variable: a no no)
|
||||
int = putint_function.args.first
|
||||
moved_int = putint_function.new_local
|
||||
utoa = context.program.get_or_create_function(:utoa)
|
||||
utoa = context.object_space.get_or_create_function(:utoa)
|
||||
b = putint_function.body
|
||||
b.mov( moved_int , int ) #move arg up
|
||||
#b.a buffer => int # string to write to
|
||||
|
Reference in New Issue
Block a user