Fixing new parfait boot process

mostly about setting the types to existing objects. 
Then after space is in place, it is set automatically

also a fair bit of misc in the commit
This commit is contained in:
2019-09-23 00:07:30 +03:00
parent e61c5d4a55
commit 7b40bb9106
16 changed files with 70 additions and 73 deletions

View File

@ -57,13 +57,7 @@ module Parfait
# type to the global list
def initialize( object_class , hash )
super()
set_object_class( object_class)
init_lists( hash )
end
# this part of the init is seperate because at boot time we can not use normal new
# new is overloaded to grab the type from space, and before boot, that is not set up
def init_lists(hash)
@object_class = object_class
@methods = nil
@names = List.new
@types = List.new
@ -75,13 +69,13 @@ module Parfait
end
def class_name
@object_class.name
@object_class&.name
end
def to_s
str = "#{class_name}-["
first = false
names.each do |name|
@names.each do |name|
unless(first)
first = true
str += ":#{name}"
@ -196,13 +190,6 @@ module Parfait
return Type.for_hash( hash , object_class)
end
def set_object_class(oc)
unless oc.is_a?(Class) #but during boot a symbol is ok
raise "object class should be a class, not #{oc.class}" unless oc.is_a?(Symbol)
end
@object_class = oc
end
def instance_length
@names.get_length()
end