shift code from class to module

as class derives from module, module carries
much of the code that one thinks of as class
class only handles allocation really
This commit is contained in:
Torsten Ruger
2015-05-18 12:35:01 +03:00
parent c983b1cba5
commit 4e3640e432
6 changed files with 51 additions and 50 deletions

View File

@ -16,12 +16,6 @@ module Parfait
# These are the same functions that Builtin implements at run-time
class Object
include FakeMem
def self.new_object *args
# Space.space.get_class_by_name(:Word)
#puts "I am #{self}"
object = self.new(*args)
object
end
# these internal functions are _really_ internal
# they respresent the smallest code needed to build larger functionality
# but should _never_ be used outside parfait. in fact that should be impossible

View File

@ -134,7 +134,7 @@ module Virtual
def boot_classes!
values = [ "Integer" , "Object" , "Value" , "Kernel"]
rest = ["Word" , "Class" , "Dictionary" , "Space" , "List", "Layout"]
(values + rest).each { |cl| @space.create_class(cl , []) }
(values + rest).each { |cl| @space.create_class(cl) }
value_class = @space.get_class_by_name "Value"
@space.get_class_by_name("Integer").set_super_class( value_class )
object_class = @space.get_class_by_name("Object")