27.3 ApplyFunc

ApplyFunc( func, arglist )

ApplyFunc invokes the function func as if it had been called with the elements of arglist as its arguments and returns the value, if any, returned by that invocation.

    gap> foo := function(arg1, arg2) 
    > Print("first ",arg1," second ",arg2,"\n"); end;
    function ( arg1, arg2 ) ... end
    gap> foo(1,2);
    first 1 second 2
    gap> ApplyFunc(foo,[1,2]);
    first 1 second 2
    gap> ApplyFunc(Position,[[1,2,3],2]);
    2 

Previous Up Top Next
Index

GAP 3.4.4
April 1997