2.13 Procedure Calls

procedure-var();
procedure-var( arg-expr {, arg-expr} );

The procedure call has the effect of calling the procedure procedure-var. A procedure call is done exactly like a function call (see Function Calls). The distinction between functions and procedures is only for the sake of the discussion, GAP does not distinguish between them.

A function does return a value but does not produce a side effect. As a convention the name of a function is a noun, denoting what the function returns, e.g., Length, Concatenation and Order.

A procedure is a function that does not return a value but produces some effect. Procedures are called only for this effect. As a convention the name of a procedure is a verb, denoting what the procedure does, e.g., Print, Append and Sort.

    gap> Read( "myfile.g" );     # a call to the procedure Read
    gap> l := [ 1, 2 ];;
    gap> Append( l, [3,4,5] );    # a call to the procedure Append 

Previous Up Top Next
Index

GAP 3.4.4
April 1997