much work on boot process

fiddly egg and chicken, though a bit clearer with parfait objects now
This commit is contained in:
Torsten Ruger
2015-05-22 22:51:36 +03:00
parent 174afb33fb
commit 94f49bf5c2
5 changed files with 48 additions and 31 deletions

View File

@ -22,6 +22,10 @@ module Parfait
@object_layout = Layout.new_object(self)
end
def object_layout
@object_layout
end
def allocate_object
#space, and ruby allocate
end

View File

@ -34,7 +34,7 @@ module Parfait
#
# TODO , later we would need to COPY the layout to keep the old constant
# but now we are concerned with booting, ie getting a working structure
def add_instance_name name
def add_instance_variable name
self.push(name)
self.get_length
end

View File

@ -25,6 +25,9 @@ module Parfait
@name
end
def instance_methods
@instance_methods
end
def add_instance_method method
raise "not a method #{method.class} #{method.inspect}" unless method.is_a? Method
raise "syserr #{method.name.class}" unless method.name.is_a? Word

View File

@ -37,23 +37,20 @@ module Parfait
# data that every object carries.
def get_class()
l = get_layout()
puts "Layout #{l.class} in #{self.class}"
puts "Layout #{l.class} in #{self.class} , #{self}"
l.get_object_class()
end
# private
def set_layout(layout)
internal_object_set(LAYOUT_INDEX , layout)
end
def get_layout()
#puts "ME #{self.class}"
return internal_object_get(LAYOUT_INDEX)
end
# class stores the "latest" layout for instances, ie the layout a new object will
# be created with.
# inside parfait (and for now everywhere) these are constant.
@@EMPTY = { :names => [] , :types => []}
def self.class_layout()
@@EMPTY
end
def get_instance_variables
get_layout().get_instance_variables
end