Question: How do I create a function with conditionals in it?

Simplest example I can think of. I want to define f(x) to be the absolute value function (yes, of course, without using the built-in Maple absolute value function) f:=x->x; is great for defining a function. I've used that many times to define n-vector-valued functions of m variables. But how do I do f:=x->x if x>0 f:=x->-x if x
Please Wait...