Product Site

5.3.3.1. of (Class Method)

Returns a newly created MapCollection object containing the specified index/item pairs. Each pair must be a single-dimensional Array with exactly two items: the index as the first Array item, and the value as the second item. The pairs are processed left-to-right and added to the MapCollection object. If no pairs are specified, an empty MapCollection is returned.

Example 5.161. MapCollection class — of method
iso639 = .Directory~of(("de", "Deutsch"), ("en", "English"), ("fr", "français"))
say iso639~allIndexes~toString(, ", ")  -- de, en, fr
say iso639~allItems~toString(, ", ")    -- Deutsch, English, français