RosettaCodeData/Task/Apply-a-callback-to-an-array/Maple/apply-a-callback-to-an-array-1.maple
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

11 lines
327 B
Text

> map( sqrt, [ 1.1, 3.2, 5.7 ] );
[1.048808848, 1.788854382, 2.387467277]
> map( x -> x + 1, { 1, 3, 5 } );
{2, 4, 6}
> sqrt~( [ 1.1, 3.2, 5.7 ] );
[1.048808848, 1.788854382, 2.387467277]
> (x -> x + 1)~( { 1, 3, 5 } );
{2, 4, 6}