Last update November 15, 2003

DWiki /
map



A function that takes a collection, a transform operation and return another collection of same size. Usually used with lists, but may be used with any kind of collection.

Using /DeimosTemplateLibrary:

    instance TFunctionalArrays(int, int) arrays;
    const int[] numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
    int square(int i) { return i ☆ i;};
    int[] squares = arrays.map(numbers, square);


(From DWiki)


FrontPage | News | TestPage | MessageBoard | Search | Contributors | Folders | Index | Help | Preferences | Edit

Edit text of this page (date of last change: November 15, 2003 5:31 (diff))