Hello GAP forum,

Is it possible to define a function that returns, say, an integer, but
changes a permutation given as argument, as a side effect.

Something like this:

testperm := function(s)
    local i;
    i := 1;
    s := s^-1;
    Print(s,"\n");
    return i;
end;

but that when running it like this...

gap> a:=(1,2,3);
(1,2,3)
gap> testperm(a);
(1,3,2)
1
gap> a;
(1,2,3)

...actually changes the permutation a.

Thanks in advance,
Rafael


_______________________________________________
Forum mailing list
Forum@mail.gap-system.org
http://mail.gap-system.org/mailman/listinfo/forum

Reply via email to