max = &
case &1 > &2 do
true -> &1
false -> &2
end
I would not consider this as an abbreviated form.
The general solution will contain all the arguments in case:
max = &
case {&1, &2} do
{a, b} when a > b -> a
{a, b} -> b
end
But this will only increase the time.
source
share