     case insufficientArguments
     case notANumber(Expression)
     case notABoolean(Expression)
+    case notAFunction(Expression)
 }
 
 extension Expression {

            if let funcName = subfunction.name {
                finalContext = extendContext(context: finalContext, name: funcName, value: closure)
            }
            return body.evaluate(context: finalContext)
        default:
            return .error("closure does not wrap function")
        }

            case "|":
                return try evaluateLogical(arguments: arguments, context: context) { a, b in a || b }
            default:
                return try evaluateUserFunction(name: name, arguments: arguments, context: context)
            }
        } catch let EvaluationError.notANumber(x) {
            return .error("\(x) is not a number")
        } catch let EvaluationError.notABoolean(x) {
            return .error("\(x) is not a boolean")
        } catch let EvaluationError.notAFunction(x) {
            return .error("\(x) is not a function")
        } catch {
            preconditionFailure("internal error: \(error)")
        }
