random tries

This commit is contained in:
Torsten Ruger
2018-03-15 10:46:17 +05:30
parent 0a9997f549
commit 163cad456f
7 changed files with 16 additions and 21 deletions

View File

@ -31,12 +31,9 @@ module Mom
left = SlotDefinition.new(left.shift , left) if left.is_a? Array
@left , @right = left , right
raise "left not SlotDefinition, #{left}" unless left.is_a? SlotDefinition
raise "right not Mom, #{right.to_rxf}" unless right.class.name.include?("Mom")
end
end
class SlotDefinition
attr_reader :known_object , :slots
def initialize( object , slots)

View File

@ -5,11 +5,17 @@ module Mom
def initialize(left , right)
right = SlotDefinition.new(right.shift , right) if right.is_a? Array
raise "right not Mom, #{right.to_s}" unless right.is_a?( SlotDefinition )
super(left , right)
end
def to_risc(context)
Risc::Label.new(self,"SlotMove")
reg = context.use_reg(:int)#( @right.ct_type)
const = Risc.load_constant(self, @right , reg)
# const.set_next Risc.reg_to_slot(self, reg , @left.known_object, @left.slots.first)
# context.release_reg(reg)
return const
end
end
end