Task

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




 
def numbers: [1,3,7,10];
 
templates cube
  $ * $ * $ !
end cube
 
// Using inline array templates (which also allows access to index by $i)
$numbers -> \[i]($ * $i !\) -> !OUT::write
$numbers -> \[i]($ * $ !\) -> !OUT::write
$numbers -> \[i]($ -> cube !\) -> !OUT::write
 
// Using array literal and deconstructor
[ $numbers... -> $ * $ ] -> !OUT::write
[ $numbers... -> cube ] -> !OUT::write
 