higher <- function(a) {
  force(a)
  CombinationFunction(
    function(x) {
      x > a
    }
  )
}
lower <- function(b) {
  force(b)
  CombinationFunction(
    function(x) {
      x < b
    }
  )
}
c1 <- higher(5)
c2 <- lower(10)
c3 <- higher(5) & lower(10)
c3(7)
Run the code above in your browser using DataLab