<head><title>ColdC: Function/Method Reference: dict_add()</title></head> <body> <h1 align=center><a href="/ColdC/">ColdC</a>: <a href="/ColdC/Functions/">Function/Method Reference</a>: dict_add()</h1> <hr> <p> <font size=+1><i>DICTIONARY</i> <b>dict_add</b>(<i>DICTIONARY <b>dict</b>, ANY <b>key</b>, ANY <b>value</b></i>)</font> <p>This function adds an association to the dictionary <var>dict</var>. The key and value of the association are given as the <var>key</var> and <var>value</var> arguments. The new dictionary is returned. If <var>key</var> already exists in <var>dict</var>, then the value of the existing key is replaced with <var>value</var>. <P>Examples: <blockquote> <PRE> dict_add(#[["foo", "bar"]], 3, 'quux) => #[["foo", "bar"], [3, 'quux]] dict_add(#[["foo", 1], ["bar", 2], ["baz", 3]], "bar", 4) => #[["foo", 1], ["bar", 4], ["baz", 3]] </PRE> </blockquote> <p><hr size=4><p align=center><i>Last Modified on 24 Mar 1996</i> <br><i>Copyright © 1995, 1996, Brandon Gillespie</i> </body>