   variableCounter = 1
   compileTop preCompileTop source
 
-# list of definitions followed by an expression
+# list of definitions followed by an expression, returns only
+# the expression part
 compiledBottom = (source) ->
   variableCounter = 1
   compileBottom preCompileBottom source

compileBottom = (ast) ->
  ast.scope = topScopeDefines()
  {body, wheres} = bottomImplementation inside ast
  compileFnImpl body, wheres

compileWheres = (ast) ->
  ast.scope = topScopeDefines()

    else
      bodyDef
  ].join '\n'

compileFnImplParts = (body, wheres) ->
  if not body
    throw new Error "Missing definition of a function"
  # Find invalid (hoistable) wheres and let the function body
  # define them
  [validWheres, hoistableWheres] = findHoistableWheres wheres
  wheresDef = compileWhereImpl validWheres
  bodyDef = compileImpl body, hoistableWheres
  [wheresDef, bodyDef]

# Returns two lists, first the wheres that can be defined, second
# the wheres which use an identifier which is not in scope (possibly
