# Shorter expression of a special conditions

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?

How about $\{ x\ \lvert\ x \in A \wedge B \}$ or $\{ x \in A\ \lvert\ B \}$? I would personally stick to your original approach, though.