Task

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




#APPTYPE CONSOLE
 
FOREACH DIM e IN MyMap(Add42, {1, 2, 3})
	PRINT e, " ";
NEXT
 
PAUSE
 
FUNCTION MyMap(f, a)
	DIM ret[]
	FOREACH DIM e IN a
		ret[] = f(e)
	NEXT
	RETURN ret
END FUNCTION
 
FUNCTION Add42(n): RETURN n + 42: END FUNCTION