     streams[index] = Bacon.constant(stream) if not (isObservable(stream))
   if streams.length
     sources = for s in streams
-      new Source(s, true, false, s.subscribeInternal)
+      new Source(s, true, s.subscribeInternal)
     withDescription(Bacon, "combineAsArray", streams..., Bacon.when(sources, ((xs...) -> xs)).toProperty())
   else
     Bacon.constant([])

      sink? end()

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
      @flatten = true

class BufferingSource extends Source
  constructor: (@obs) ->
    queue = []
    super(@obs, true, false, @obs.subscribeInternal, false, queue)
    @consume = ->
      values = queue
      queue = []
      -> values
    @push = (x) -> queue.push(x())
    @hasAtLeast = -> true

Source.fromObservable = (s) ->
  if s instanceof Source
    s
  else if s instanceof Property
    new Source(s, false, false)
  else
    new Source(s, true, true)

describe = (context, method, args...) ->
  if (context || method) instanceof Desc

    else
      lazy = true
      combinator = (f) -> f()
    thisSource = new Source(this, false, this.subscribeInternal, lazy)
    samplerSource = new Source(sampler, true, sampler.subscribeInternal, lazy)
    stream = Bacon.when([thisSource, samplerSource], combinator)
    result = if sampler instanceof Property then stream.toProperty() else stream
    withDescription(this, "sampledBy", sampler, combinator, result)
