 exports.compileTopLevel = compileTopLevel
 exports.compileModule = compileModule
 exports.compileExpression = compileExpression
+exports.expand = expandCall
 exports.findAvailableTypes = findAvailableTypes
 exports.findMatchingDefinitions = findMatchingDefinitions
 exports.findDocsFor = findDocsFor

    ast: ast
    errors: errors
    malformed: ctx.isMalformed

importsFor = (moduleSet) ->
  lookupDefinitions = (name) ->

        (call_ (join [expandedOp], (_arguments call)))

callMacroCompile = (ctx, call) ->
  expanded = callMacroExpand ctx, call
  if isTranslated expanded
    expanded
  else
    compiled = expressionCompile ctx, expanded
    retrieve call, expanded
    compiled

callMacroExpand = (ctx, call) ->
  op = _operator call
  op.label = 'keyword'
  macro = ctx.macro op.symbol
  op.id = macro.id
  macro ctx, call

isTranslated = (result) ->
  (isSimpleTranslated result) or (Array.isArray result) and ((_empty result) or (isSimpleTranslated result[0]))
