2014-06-26 17:39:02 +02:00
|
|
|
module Virtual
|
|
|
|
|
|
|
|
# the virtual machine is implemented in values. Values have types which are represented as classes, but it is still
|
|
|
|
# important to make the distinction. Values are immutable, passed by value and machine word sized.
|
|
|
|
|
|
|
|
# Integer and (Object) References are the main derived classes, but float will come and ...
|
|
|
|
# The Mystery Value has unknown type and has only casting methods. So it must be cast to be useful.
|
|
|
|
class Value
|
2014-07-01 14:57:13 +02:00
|
|
|
def == other
|
|
|
|
other.class == self.class
|
|
|
|
end
|
|
|
|
def inspect
|
|
|
|
self.class.name + ".new()"
|
|
|
|
end
|
2014-06-26 17:39:02 +02:00
|
|
|
def type
|
|
|
|
self.class
|
|
|
|
end
|
|
|
|
private
|
|
|
|
def initialize
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|