remove class_eval on slots to map registers

Use their class names (or for now called object names)
these are the same that Register helper functions accept already anyway
This commit is contained in:
Torsten Ruger
2015-06-30 09:39:45 +03:00
parent c4502c5030
commit bd77db656a
6 changed files with 22 additions and 27 deletions

View File

@ -7,6 +7,10 @@ module Virtual
def initialize type = Unknown, value = nil
super
end
def object_name
return :frame
end
end
end

View File

@ -10,6 +10,9 @@ module Virtual
def initialize type = Unknown , value = nil
super(type , value )
end
def object_name
:message
end
end
# named classes exist for slots that often accessed

View File

@ -10,6 +10,9 @@ module Virtual
def initialize type = Unknown, value = nil
super( type , value )
end
def object_name
:new_message
end
end
# named classes exist for slots that often accessed

View File

@ -17,5 +17,8 @@ module Virtual
def initialize type = Unknown, value = nil
super
end
def object_name
:self
end
end
end

View File

@ -18,6 +18,13 @@ module Virtual
class Slot < Object
# the name of the object of a slot is a symbol that represents what the class name describes
# ie it is one of :message , :self , :frame , :new_message
# one of the objects the machine works on.
def object_name
raise "abstract called #{self}"
end
attr_accessor :type , :value
private #abstract base class