I tried to define a procedure in Maple as follows. removeAnElementInList:=proc(i, l) local r, j; r:=[]; for j from 1 to lengthOfList(l) do ( if(j<>i) then r:=append(r, l[j]) end if ) end do; return(r); end proc;
But Maple returns an error: invalid sequence (at "then"). But I don't know where is the problem. I checked the codes for half an hour but didn't find the problem. Any help will be greatly appreciated!
Now its correct