There is no problem (although some Computer Scientists would say that it is a
bad idea) with a GAP function modifying its arguments. As a an example here
is a function which swaps the first elements of its two list arguments and
returns true if they are equal, false if not, and fail if one of the lists had
no first entry.