Partial implementation of an if expression