     [(jsReturn (jsDictionary exportList, exportList))]]))
 
 ms = {}
+
+
+# module+ (syntax [..args]
+#   (` export (module ,..args)))
+ms['module+'] = ms_module_export = (ctx, call) ->
+  (call_ (token_ 'export'), [(call_ (token_ 'module'), (_arguments call))])
+
+ms.module = ms_module = (ctx, call) ->
+  requireName ctx, 'Module name required'
+  name = ctx.definitionName()
+  if name
+    # TODO: here we need to propagate request and use compiled js
+    result = compileModuleTopLevelAst (form_ (_arguments call)), joinModuleNames ctx.moduleName, name
+    if result.request
+      ctx.req result.request, newSet()
+    else
+      console.log "submodule", result.js
+      if result.errors
+        ctx.extendSubstitution fails: result.errors # propagate errors TODO: rename substitution which is only used for type errors now
+      jsValue result.js
+  else
+    jsNoop()
+
+joinModuleNames = (parent, child) ->
+  "#{parent}/#{child}"
+
+ms.export = ms_export = (ctx, call) ->
+  requireName ctx, 'Name to export required'
+  name = ctx.definitionName()
+  if name
+    ctx.exportName name
+  expressionCompile ctx, _fst _arguments call
+
+# fn+ (syntax [..args]
+#   (` export (fn ,..args)))
+ms['fn+'] = ms_fn_export = (ctx, call) ->
+  (call_ (token_ 'export'), [(call_ (token_ 'fn'), (_arguments call))])
+
 ms.fn = ms_fn = (ctx, call) ->
     # For now expect the curried constructor call
     args = _arguments call

    scope.deferred = []
    scope.deferredBindings = []
    scope.boundTypeVariables = newSet()
    scope.classes = newMap()
    scope.typeNames = newMap()
    scope.typeAliases = newMap()


jsWrapTranslate = ({value}) ->
  "(#{value})"


blockOfLines = (lines) ->
  if lines.length is 0
