bloom-lang / bud

Prototype Bud runtime (Bloom Under Development)
http://bloom-lang.net
Other
854 stars 60 forks source link

notin bug #291

Closed palvaro closed 11 years ago

palvaro commented 11 years ago

below is a small program that isolates an issue I noticed with notin. when run, :outp has a tuple in two different timesteps, when it should only have one in the first.

note also that if you comment out the notin and replace it with the semantically equivalent "not ... include?" (in comments below), only one tuple is printed.

class AMO include Bud state do scratch :inp, [:payload] table :delivered, inp.schema scratch :outp, inp.schema end

bloom do outp <= inp.notin(delivered, :payload => :payload)

outp <= inp do |i|

#  i unless delivered.include? i
#end
delivered <+ inp
stdio <~ outp{|p| ["#{p} @ #{budtime}"]}

end end

alice = AMO.new alice.inp <+ [["foo"]] alice.tick alice.inp <+ [["foo"]] alice.tick alice.inp <+ [["foo"]] alice.tick

neilconway commented 11 years ago

I'll take a look...