Question: When using the arrow operator for procedure definition?

When should i use ->  for a procedure definition and when not ?
In my post i do see examples of  procedures which are made on two different ways.
proc  ..end proc;

Still difficult to get a procedure on two ways 

test:=x->x^2;
Typesetting:-mprintslash([(test := x -> x^2)],[x -> x^2])

test(2);
4

restart;
test:= proc()
local x,a;
a:= x^2;
end ;
Typesetting:-mprintslash([(test := proc () local x, a; a := x^2; end proc)],[
proc () local x, a; a := x^2; end proc])

test(2);
x^2

test(3);
x^2

As you can see with the standard proc definition i getlost with  calculating x^2 

Please Wait...