remove the space instance from register machine

bad design, probably from the booting
This commit is contained in:
Torsten Ruger
2016-12-30 14:04:59 +02:00
parent ef872edd7a
commit a00f6be3ba
30 changed files with 121 additions and 94 deletions

View File

@ -108,7 +108,7 @@ module Typed
# class_name and method_name are pretty clear, args are given as a ruby array
def create_method( class_name , method_name , args = {})
raise "create_method #{class_name}.#{class_name.class}" unless class_name.is_a? Symbol
clazz = Register.machine.space.get_class_by_name! class_name
clazz = Parfait::Space.object_space.get_class_by_name! class_name
create_method_for( clazz.instance_type , method_name , args)
end

View File

@ -46,7 +46,7 @@ module Typed
when Parfait::Type
type = me.type
when Symbol
type = Register.machine.space.get_class_by_name(me.type).instance_type
type = Parfait::Space.object_space.get_class_by_name(me.type).instance_type
else
raise me.inspect
end

View File

@ -52,6 +52,23 @@ module Parfait
@@object_space = space
end
def each_type
@types.values.each do |type|
yield(type)
end
end
# all methods form all types
def collect_methods
methods = []
each_type do | type |
type.methods.each do |meth|
methods << meth
end
end
methods
end
def get_main
kernel = get_class_by_name :Space
kernel.instance_type.get_method :main

View File

@ -7,7 +7,7 @@ class Symbol
true
end
def get_type
l = Register.machine.space.classes[:Word].instance_type
l = Parfait::Space.object_space.classes[:Word].instance_type
#puts "LL #{l.class}"
l
end