     if @positions.hasOwnProperty name
       @variables[@positions[name]].type = type
     else
-      @positions[name] = @variables.length
-      @variables.push {name, type}
+      @positions[name] = -1 + @variables.push {name, type}
+    this
 
   # Create a new garbage level
   startLevel: ->
     @garbage.push []
+    this
 
   # Return to the previous garbage level and erase referenced temporary
   # variables in current level from scope.
   endLevel: ->
-    vars = @variables
-    for garbage in @garbage.pop() when @type(garbage) is 'var'
-      @setVar garbage, 'reuse'
+    @setVar name, 'reuse' for name in @garbage.pop() when @type(name) is 'var'
+    this
 
   # Look up a variable name in lexical scope, and declare it if it does not
   # already exist.

    index = 0
    index++ while @check(temp = @temporary type, index) and @type(temp) isnt 'reuse'
    @setVar temp, 'var'
    last(@garbage).push temp if @garbage.length
    temp

  # Ensure that an assignment is made at the top of this scope

    @setVar name, 'var'
    false

  # Test variables and return `true` the first time `fn(v)` returns `true`
  any: (fn) ->
    for v in @variables when fn v then return true
    return false

  # Reserve a variable name as originating from a function parameter for this
