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

    @consume = ->
      values = queue
      queue = []
      values
    @push = (x) -> queue.push(x())
    @hasAtLeast = -> true



class Source
  constructor: (@obs, @sync, consume, @subscribe, lazy = false, queue = []) ->
    lazify = if lazy then (x) -> (-> x) else _.id
    @subscribe = obs.subscribeInternal if not @subscribe?
    @markEnded = -> @ended = true
    @toString = @obs.toString
    if consume
      @consume = -> lazify(queue.shift())
      @push  = (x) -> queue.push(x)
      @mayHave = (c) -> !@ended || queue.length >= c
      @hasAtLeast = (c) -> queue.length >= c
      @flatten = false
    else
      @consume = -> lazify(queue[0])
      @push  = (x) -> queue = [x]
      @mayHave = -> true
      @hasAtLeast = -> queue.length
