 # end of Utils
 
 # Unit tests
-test = (name, teaSource, result) ->
+test = (testName, teaSource, result) ->
   try
     compiled = (topLevelAndExpression teaSource)
   catch e
-    logError "Failed to compile test |#{name}|\n#{teaSource}\n", e
+    logError "Failed to compile test |#{testName}|\n#{teaSource}\n", e
     return
   try
     log (collapse toHtml compiled.ast)


  'classes'
  """Show (class [a]
       show (fn [x] (: (Fn a String))))

    show-string (instance (Show String)
       show (fn [x] x))

    aliased-show (fn [something]
       (show something))

    showed-simply (show "Hello")
    showed-via-alias (aliased-show "Hello")"""
  "(= showed-simply showed-via-alias)", yes

]


  [terms..., expression] = _terms ast
  ctx = new Context
  compiledDefinitions = compileDefinitionList ctx, terms
  compiledExpression = compileExpression ctx, expression
  types: ctx._scope()
  subs: filterMap ((name) -> name is 'could not unify'), ctx.substitution
  ast: ast
