2016-12-06 10:38:09 +01:00
|
|
|
# Parfait is the ruby runtime
|
|
|
|
module Parfait
|
2019-02-10 20:00:25 +01:00
|
|
|
TYPE_INDEX = 0
|
|
|
|
|
|
|
|
class Object
|
|
|
|
def self.memory_size
|
|
|
|
8
|
|
|
|
end
|
|
|
|
def self.type_length
|
|
|
|
1
|
|
|
|
end
|
|
|
|
def self.new( *args )
|
|
|
|
object = self.allocate
|
|
|
|
# have to grab the class, because we are in the ruby class not the parfait one
|
|
|
|
cl = Parfait.object_space.get_class_by_name( self.name.split("::").last.to_sym)
|
|
|
|
# and have to set the type before we let the object do anything. otherwise boom
|
|
|
|
object.set_type cl.instance_type
|
|
|
|
object.send :initialize , *args
|
|
|
|
object
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
["object" , "factory" ].each do |file_name|
|
|
|
|
path = File.expand_path( "../parfait/#{file_name}.rb" , __FILE__)
|
|
|
|
module_eval( File.read path)
|
|
|
|
end
|
2016-12-06 10:38:09 +01:00
|
|
|
end
|
|
|
|
|
2018-03-25 17:22:02 +02:00
|
|
|
require_relative "parfait/data_object"
|
|
|
|
require_relative "parfait/integer"
|
2015-11-18 11:04:25 +01:00
|
|
|
require_relative "parfait/behaviour"
|
|
|
|
require_relative "parfait/class"
|
|
|
|
require_relative "parfait/list"
|
|
|
|
require_relative "parfait/word"
|
|
|
|
require_relative "parfait/binary_code"
|
2018-07-07 08:11:09 +02:00
|
|
|
require_relative "parfait/callable"
|
2018-07-07 14:50:43 +02:00
|
|
|
require_relative "parfait/block"
|
2018-07-07 08:11:09 +02:00
|
|
|
require_relative "parfait/callable_method"
|
2017-12-10 19:47:26 +01:00
|
|
|
require_relative "parfait/vool_method"
|
2015-11-18 11:04:25 +01:00
|
|
|
require_relative "parfait/dictionary"
|
2016-02-25 20:50:10 +01:00
|
|
|
require_relative "parfait/type"
|
2018-03-17 14:33:39 +01:00
|
|
|
require_relative "parfait/cache_entry"
|
2015-11-18 11:04:25 +01:00
|
|
|
require_relative "parfait/message"
|
2016-12-21 17:45:18 +01:00
|
|
|
require_relative "parfait/named_list"
|
2015-11-18 11:04:25 +01:00
|
|
|
require_relative "parfait/space"
|