It is more about scoping than FP…
I would do it like this if needed
a = if ..., do: 2, else: other_value