Name

add — Add a key/value pair to a map

Synopsis

map add ( map  MAP,
  any  KEY,
  any  VALUE);

Parameters

map MAP

any KEY

any VALUE

Return

map

Description

 Adds the key/value pair k : v to the map MAP and returns the newly Created map. If the key KEY exists in KEY, the old key/value pair is replaced with the new one.
Functionality partly replaced with syntax: map map m = $["a":1]; m["b"] = 2; -> $["a":1, "b":2]

Usage

  add ($["a": 17, "b": 11], "c", 2) -> $["a":17, "b":11, "c":2]
  add ($["a": 17, "b": 11], "b", 2) -> $["a":17, "b":2]