   [terms..., expression] = _terms ast
   ctx = new Context
   compiledDefinitions = compileDefinitionList ctx, terms
-  compiledExpression = translateToJs translateIr ctx, topLevelExpression ctx, expression
+  compiledExpression = compileExpression ctx, expression
   types: ctx._scope()
   subs: filterMap ((name) -> name is 'could not unify'), ctx.substitution
   ast: 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

]


# end of Utils

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