In which programming languages is a conditional block (if) not syntactically different than a function invocation, including any "else" block of code to be executed in the false condition? In other words, in what languages could one define a function an_alternative_if_function which could then be invoked interchangeably with if?
For example, in Ruby, an if clause could be represented like this:
if(a > 20){
puts("A is greater than 20.")
}
In that block, at least, if appears similar to any other function. It appears as if this if function is then passed an expression as an argument/parameter and also passed a block of code, as does, in fact, occur in the following functional Ruby code fragment:
def an_alternative_if_function(condition){
yield if condition
}
an_alternative_if_function(a > 20){
puts("A is greater than 20.")
}
However, Ruby is not a correct answer to my question, because there is no way for a Ruby function to accept an else clause in the way that if does. The following is incorrect syntax:
an_alternative_if_function(a > 20){
puts("A is greater than 20.")
} else {
puts("A is not greater than 20.")
}
Update: My guess about Lisp below is incorrect. See Answers.
On the other hand, I reckon Lisp is one correct answer to my question, because in the following example code, if appears as a function which accepts 3 arguments:
(if (> a 20)
(write-line "A is greater than 20.")
(write-line "A is not greater than 20."))
I'm unconcerned about the implementation details of compilers and interpreters. My only concern is whether if is syntactically distinguishable from other functions to the programmer reading the code.