Question: unexpected result from function call

restart;
a := 10;
ff := proc()

       ##local a,b;

        b := a + 10:  #### implicit local

         return b:

        end proc:
ff();

output: 20

restart;

a := 10:
ff := proc()

       ##local a,b;

        b := a + 10:   #### implicit local

        a:=b:

        return b:

        end proc:
ff();

output: a+10

expected: 20

Please explain the reason

 

Please Wait...