

PROCEDURE mapcar(f,x);
(*map the function f to the elements of the list x. *)
VAR   y, e, r: ANY;
BEGIN
(*1*) y:=NIL; r:=x;
(*2*) WHILE r # NIL DO 
            ADV(r, e, r);
            e:=f(e); y:=COMP(e,y)
            END; 
      y:=INV(y); RETURN(y);
(*9*) END mapcar.


a:=LIST(1,2,3,4,5).

p:=mapcar(INEG,a).


