I actually saw this first in SICP, but then proceeded to see if F# can do this. Basically it’s an if statement that selects a method to use based on a clause, and then evaluates using two parameters.
let add x y = x + y let sub x y = x - y (if 0 = 0 then add else sub) 1 2
As you can see, the parameters stay the same but the actual method called doesn’t. The way it’s written, it evaluates to:
add 1 2
However, were I to switch the 0 = 0 to 0 = 1 then:
sub 1 2
Not sure how this would apply to real life, but knowing is the first step.