   
   return result
 
-RW.visitCircuitChip = (circuitMeta, path, chip, constants, parentCircuitData, bindings) ->
+RW.visitCircuitChip = (circuitMeta, path, chip, constants, parentCircuitData, scratchData, bindings) ->
   # Expect chip data like { circuit: circuitType, id: circuitId: , children: , pins: }
   # Look up chip
   circuit = constants.circuits[chip.circuit]


  return result

RW.visitSplitterChip = (circuitMeta, path, chip, constants, circuitData, oldBindings) ->
  bindingSet = RW.calculateBindingSet(circuitMeta, path, chip, constants, circuitData, oldBindings)
  result = new RW.ChipVisitorResult()
  for newBindings in bindingSet
    # Continue with children
    for childIndex, child of (chip.children or [])
      childResult = RW.visitChip(circuitMeta, RW.appendToArray(path, childIndex), child, constants, circuitData, newBindings)
      result.append(childResult)
  return result

RW.visitEmitterChip = (circuitMeta, path, chip, constants, circuitData, bindings) ->
  evaluationContext = RW.makeEvaluationContext(circuitMeta, constants, circuitData, bindings)

  # Return "DONE" signal, so it can be put in sequences
  result = new RW.ChipVisitorResult(RW.signals.DONE)  


  return conflicts

RW.getPatchDestination = (patch) -> patch.add or patch.replace or patch.remove

# Creates a patch to the outputAddress of the given outputValue and appends it to the result
# TODO: what an unweildy function, with more parameters than lines! Need to refactor it somehow
RW.derivePatches = (circuitMeta, path, bindings, evaluationContext, result, outputAddress, outputValue) -> 
