Let $A$ be a set and $B$ a condition (can be either true or false). Is there any shorter description of the expression $$ x = \begin{cases} A & B \\ \emptyset & \text{otherwise} \end{cases} \text{?} $$ An inline solution would be nice.
One possibility is to define $$ \text{cond}(A, B) = \begin{cases} A & B \\ \emptyset & \text{otherwise} \end{cases} $$ and set $x = \text{cond}(A, B)$. But is there a more "intuitive" way to do this without defining a new function?