       subjectCode(code)
 
   getStreamCodeAndAccumulateFunctions = (expr) ->
-    exprResult = exprCode expr, functionInfo, localNames
+    exprResult = exprCode expr, functionInfo
     accumulateFunctionNames exprResult.functionNames
     accumulateLocalStreams exprResult.localStreams
     localStreamCode expr, exprResult.code, exprResult.combineNames

  {code: bodyCode, functionNames}

exprCode = (expr, functionInfo, incomingLocalNames = []) ->
  localNames = [].concat incomingLocalNames
  functionNames = []
  localStreams = []
  combineNames = []

  isTransformFunction = (functionCall) -> functionInfo[functionCall.functionName]?.kind == 'transform'
  isStreamFunction = (functionCall) -> functionInfo[functionCall.functionName]?.kind == 'stream'

  getCodeAndAccumulateFunctions = (expr, localNames) ->
    allLocalNames = incomingLocalNames[..].concat localNames
    exprResult = exprCode expr, functionInfo, allLocalNames
    accumulateFunctionName(n) for n in _.difference exprResult.functionNames, allLocalNames
    accumulateCombineName(n) for n in _.filter exprResult.combineNames, (n) -> not _.contains allLocalNames, n.name
    accumulateLocalStreams exprResult.localStreams
    exprResult.code

