 #   expression.compiled
 
 callCompile = (ctx, call) ->
-  op = _operator call
-  if isName op
-    (if op.token of ctx.macros()
+  operator = _operator call
+  operatorName = _token operator
+  if isName operator
+    (if operatorName of ctx.macros()
       macroCompile
-    else
-      callKnownCompile) ctx, call
-  else
-    expandedOp = termCompile ctx, op
+    else if ctx.arity operatorName
+      callKnownCompile
+    else
+      callUnknownCompile) ctx, call
+  else
+    expandedOp = termCompile ctx, operator
     if isTranslated expandedOp
       callUnknownTranslate ctx, expandedOp, call
     else


  extendSubstitution: (substitution) ->
    @substitution = joinSubs substitution, @substitution

  newJsVariable: ->
    "i#{@variableIndex++}"

        [body, wheres...] = defs
      paramNames = map _token, params
      # pattern
      paramTypes = map (-> toForAll ctx.freshTypeVariable star), params
      ctx.newLateScope()
      # log "adding types", (map _token, params), paramTypes
      ctx.addTypes (map _token, params), paramTypes
      # log "types added"
      log "compiling", body
      compiledBody = termCompile ctx, body
      # log "compiled", body.tea
      ctx.closeScope()

      # Syntax - used params in function body
      # TODO: possibly add to nameCompile instead, or defer to IDE
      isUsedParam = (expression) ->
        (isName expression) and (_token expression) in paramNames
      map (syntaxNameAs '', 'param'), filterAst isUsedParam, body

      # Arity - before deferring instead go to assignCompile, because this makes the naming of functions special
      if ctx._name()
        log "adding arity for #{ctx._name()}", paramNames
        ctx.addArity ctx._name(), paramNames

      assignCompile ctx, call,
        if ctx.shouldDefer()
          'deferred'
        else
          # Typing
          if not body.tea
            log body
            throw "Body not typed"
          call.tea = typeFn (map _type, paramTypes)..., body.tea

          """λ(function (#{listOf paramNames}) {
            return #{compiledBody};
          }"""
  # data
  #   listing or
  #     pair
