require 'rubygems'
require 'bud'
class Phooey
include Bud
state do
lmax :cloq
scratch :truth, []=>[:val]
end
bootstrap do
truth <+ [[true]]
cloq <+ Bud::MaxLattice.new(0)
end
bloom do
# frame rule for truth
truth <+ truth
# A process increments its counter before each event in that process;
cloq <+ truth {|t| cloq + 1}
stdio <~ truth {|t| [cloq.inspect]}.inspected
end
end
p = Phooey.new
p.tick
p.tick
p.tick
But when you replace the scratch and frame rule with a table, it's as if it only ticks once!
require 'rubygems'
require 'bud'
class Phooey
include Bud
state do
lmax :cloq
table :truth, []=>[:val]
end
bootstrap do
truth <+ [[true]]
cloq <+ Bud::MaxLattice.new(0)
end
bloom do
# A process increments its counter before each event in that process;
cloq <+ truth {|t| cloq + 1}
stdio <~ truth {|t| [cloq.inspect]}.inspected
end
end
p = Phooey.new
p.tick
p.tick
p.tick
The following code behaves as you would expect:
But when you replace the scratch and frame rule with a table, it's as if it only ticks once!