Task

Take a combined set of elements and apply a function to each element.




 
PROGRAM CALLBACK
 
!
! for rosettacode.org
!
 
DIM A[5]
 
FUNCTION CBACK(X)
   CBACK=2*X-1
END FUNCTION
 
PROCEDURE PROCMAP(ZETA,DUMMY(X)->OUTP)
   OUTP=DUMMY(ZETA)
END PROCEDURE
 
BEGIN
   A[1]=1  A[2]=2   A[3]=3  A[4]=4  A[5]=5
   FOR I%=1 TO 5 DO
      PROCMAP(A[I%],CBACK(X)->OUTP)
      PRINT(OUTP;)
   END FOR
   PRINT
END PROGRAM
 