rename layout to type

this one goes to caleb for pointing it out.
Much better word
This commit is contained in:
Torsten Ruger
2016-02-25 11:50:10 -08:00
parent 3480b97eaa
commit d32b51c67b
39 changed files with 328 additions and 328 deletions

View File

@ -1,5 +1,5 @@
# Class is mainly a list of methods with a name (for now)
# The memory layout of object is seperated into Layout
# The memory type of object is seperated into Layout
# A class describes the capabilities of a group of objects, ie what data it has
# and functions it responds to.
@ -17,16 +17,16 @@
module Parfait
class Class < Object
include Behaviour
attributes [:object_layout , :name , :super_class_name]
attributes [:object_type , :name , :super_class_name]
def initialize name , superclass
super()
self.name = name
self.super_class_name = superclass
# the layout for this class (class = object of type Class) carries the class
# the type for this class (class = object of type Class) carries the class
# as an instance. The relation is from an object through the Layout to it's class
# TODO the object layout should copy the stuff from superclass
self.object_layout = Layout.new(self)
# TODO the object type should copy the stuff from superclass
self.object_type = Type.new(self)
end
def allocate_object
@ -34,7 +34,7 @@ module Parfait
end
def add_instance_name name
self.object_layout.push name
self.object_type.push name
end
def sof_reference_name
@ -48,7 +48,7 @@ module Parfait
def create_instance_method method_name , arguments
raise "create_instance_method #{method_name}.#{method_name.class}" unless method_name.is_a?(Symbol)
clazz = object_layout().object_class()
clazz = object_type().object_class()
raise "??? #{method_name}" unless clazz
#puts "Self: #{self.class} clazz: #{clazz.name}"
add_instance_method Method.new( clazz , method_name , arguments )