Passing Ordered Maps

Language enhancement: ordered maps may now be passed by reference to functions and procedures. Conceptually and syntatically this is very similar to passing other kinds of DIMX arrays by reference. On the calling side, you specify the array in the parameter list using an empty set of parentheses, for example...

dimx $mymap, ordmap(varstr;varstr)

...

call MyProc($mymap())      ! pass $mymap() array by reference

 

On the receiving side you declare the local name for the array in the parameter definition also with an empty set of parentheses, with the "as clause" specifying the ordered map type, e.g.

Procedure MyProc($m() as ordmap(varstr;varstr))

    $m("foo") = "bar"      ! updating m$() updates $mymap() directly

 

As with other DIMX array passing, the compiler does not attempt to determine if the source and destination array formats are compatible, but the runtime system enforces a degree of sanity, in this case, complaining if you attempt to pass an ordmap(varstr;varx) to an ordmap(varstr;varstr) or vice versa.