Question: Error, invalid input: unknown uses a 1st argument, A (of type Array(numeric)), which is missing

Hi, Maple is totally new to me and I found something confusing.

Here is what I have:

the_first_element:= proc( A:: Array( numeric ) ) ;
A[1];
end proc():

And it shows Error, invalid input: unknown uses a 1st argument, A (of type Array(numeric)), which is missing.

 

But in another similar procedure, I have exactly the same lines but it goes without error. 

locate_max := proc( A :: Array( numeric ) )
if ArrayNumDims(A) <> 1 then
    error "can only search 1d arrays"
  end if:
end proc: 

I have no idea what is wrong with these 4 lines.

Thank you in advance!

Please Wait...