     for i in [0...indent] then ind += '  '
     console.log "#{ind}#{msg}"
 
-  makeTracing = (name, fn) -> (args...) ->
-    log "(#{@}).#{name}(#{args.join ', '})"
-    indent++
-    res = fn.apply @, args
-    indent--
-    log "-> #{res}"
-    res
+  makeTracing = (name, fn) ->
+    (args...) ->
+      log "(#{@}).#{name}(#{args.join ', '})"
+      indent++
+      res = fn.apply @, args
+      indent--
+      log "-> #{res}"
+      res
 
   (arg) ->
     for own name, fn of arg

  @trace reduce: -> @
  @trace apply: -> no
  @trace replace: (varName, node) ->
    if varName is @name
      node
    else
      @

class AbsNode extends Node
  constructor: (@varName, @body) ->

    new AbsNode @varName, @body.reduce()
  @trace apply: (node) ->
    @body.replace @varName, node
  @trace replace: (varName, node) ->
    # TODO rename this abstraction's @varName in @body if @varName is in "node"'s free vars.
    # The parameter of this abstraction makes a new context, so no replacement
    # is needed.
    return @ if varName is @varName
    new AbsNode @varName, @body.replace varName, node

class ApplyNode extends Node
  constructor: (@left, @right) ->
