         return ErrorValue.nan
     }
     return DoubleValue(number: result)
-}))
-
-fileprivate let divide = binaryOperator(dereferencing({ (operand1, operand2, context) in
+}
+
+fileprivate let divide = binaryOperator(dereferencing: true) { (operand1, operand2, context) in
     let numerableValue1 = operand1.cast(to: .numerable, context: context)
     if numerableValue1 is ErrorableValue {
         return numerableValue1

internal typealias BinaryEvaluator = (_ operand1: Value, _ operand2: Value, _ context: EvaluateContext) -> Value
fileprivate typealias UnaryEvaluator = (_ operand: Value, _ context: EvaluateContext) -> Value

fileprivate func binaryOperator(_ evaluator: @escaping BinaryEvaluator) -> Function {
    return { (parameters, context) in
        if parameters.count != 2 {
            return ErrorValue.invalidArgumentCount
        }
        
        let expression1 = parameters[0]
        let operand1 = expression1.evaluate(with: context)
        if operand1 is ErrorableValue {
            return operand1
        }
        
        let expression2 = parameters[1]
        let operand2 = expression2.evaluate(with: context)
        if operand2 is ErrorableValue {
            return operand2
        }

fileprivate let greaterThan = comparisonOperator { $0 > 0 }
fileprivate let greaterThanOrEqualTo = comparisonOperator { $0 >= 0 }

fileprivate let add = binaryOperator(dereferencing: true) { (operand1, operand2, context) in
    let numerableValue1 = operand1.cast(to: .numerable, context: context)
    if numerableValue1 is ErrorableValue {
        return numerableValue1
