       rhs = fake_()
     definitionPairCompile ctx, lhs, rhs)
 
-  compiledPairs = join compiledPairs, compileDeferred ctx
-  resolveDeferredTypes ctx
-  compiledPairs = join compiledPairs, compileDeferred ctx
-  resolveDeferredTypes ctx
+  shouldRecompile = yes
+  while shouldRecompile
+    compiledPairs = join compiledPairs, compileDeferred ctx
+    shouldRecompile = _notEmpty ctx.deferredBindings()
+    resolveDeferredTypes ctx
   deferDeferred ctx
 
   filter _is, compiledPairs

# Syntax printing to HTML

toHtml = (highlighted) ->
  crawl highlighted, (word, symbol, parent) ->
    (word.ws or '') + colorize(theme[labelOf word, parent], symbol)

labelOf = (word, parent) ->
  word.malformed and 'malformed' or
    parent?.malformed and word.symbol in allDelims and 'malformed' or
      word.label or 'normal'

collapse = (nodes) ->
  collapsed = ""

      ctx.addToDeferredNames {name: symbol, type: type}
      nameTranslate ctx, atom, symbol, type
    else
      # log "deferring in rhs for #{symbol}", ctx.definitionName()
      ctx.doDefer atom, symbol
      translation: deferredExpression()

