remove Kernel class for clarification

since it was a class it was fake anyway
moved methods to object
This commit is contained in:
Torsten Ruger
2018-04-02 17:06:31 +03:00
parent 87eee0b66e
commit 9fafbe4e96
9 changed files with 80 additions and 94 deletions

View File

@@ -41,7 +41,7 @@ module Parfait
end
# get the method and if not found, try superclasses. raise error if not found
def resolve_method m_name
def resolve_method( m_name )
raise "resolve_method #{m_name}.#{m_name.class}" unless m_name.is_a?(Symbol)
method = get_instance_method(m_name)
return method if method

View File

@@ -29,7 +29,7 @@ module Parfait
# While data ususally would live in a .data section, we may also "inline" it into the code
# in an oo system all data is represented as objects
class Space < Object
class Space < Object
def initialize( classes )
@classes = classes
@@ -83,13 +83,13 @@ module Parfait
end
def get_main
kernel = get_class_by_name :Space
kernel.instance_type.get_method :main
space = get_class_by_name :Space
space.instance_type.get_method :main
end
def get_init
kernel = get_class_by_name :Kernel
kernel.instance_type.get_method :__init__
object = get_class_by_name :Object
object.instance_type.get_method :__init__
end
# get a class by name (symbol)