func (this IntValue) Div(value interfaces.Value) interfaces.Value { denominator := value.PrimitiveValue().(int) // since default value of int question will be set to zero, handle it here to preclude division by zero panic if denominator == 0 { return NewIntValue(0) } return NewIntValue(this.primitiveValue / denominator) }
func (this BoolValue) NEq(value interfaces.Value) interfaces.Value { return NewBoolValue(this.primitiveValue != value.PrimitiveValue()) }
func (this BoolValue) Or(value interfaces.Value) interfaces.Value { return NewBoolValue(this.primitiveValue || value.PrimitiveValue().(bool)) }
func (this IntValue) Sub(value interfaces.Value) interfaces.Value { return NewIntValue(this.primitiveValue - value.PrimitiveValue().(int)) }
func (this IntValue) LT(value interfaces.Value) interfaces.Value { return NewBoolValue(this.primitiveValue < value.PrimitiveValue().(int)) }
func (this StringValue) Add(value interfaces.Value) interfaces.Value { return NewStringValue(fmt.Sprintf("%s%s", this.primitiveValue, value.PrimitiveValue().(string))) }
func (this StringValue) LT(value interfaces.Value) interfaces.Value { return NewBoolValue(this.primitiveValue < value.PrimitiveValue().(string)) }
func (this StringValue) Eq(value interfaces.Value) interfaces.Value { return NewBoolValue(this.primitiveValue == value.PrimitiveValue()) }