   consume: ->
     values = @queue
     @queue = []
-    -> values
-  push: (x) -> @queue.push(x())
+    {value: -> values}
+  push: (x) -> @queue.push(x.value())
   hasAtLeast: -> true
 
 Source.isTrigger = (s) ->

          for p in pats
            if match(p)
              #console.log "match", p
              functions = (sources[i.index].consume() for i in p.ixs)
              reply = sink trigger.e.apply ->
                values = (fun() for fun in functions)
                p.f(values...)
              if triggers.length
                triggers = _.filter nonFlattened, triggers

  isInitial: -> true
  isNext: -> false
  apply: (value) -> new Initial(value)
  toNext: ->
    if @valueInternal
      new Next(@valueInternal, true)
    else
      new Next(@value)

class End extends Event
  isEnd: -> true
