Comparison of programming languages (associative array): Difference between revisions

Content deleted Content added
Line 865:
Iterating through a mapping can be done using either foreach:
 
<source lang=Textpike>
foreach(phonebook; string key; string value) {
write("%s:%s\n", key, value);
Line 873:
Or using an iterator object:
 
<source lang=Textpike>
Mapping.Iterator i = get_iterator(phonebook);
while (i->index()) {
Line 883:
Elements of a mapping can be removed using m_delete, which returns the value of the removed index:
 
<source lang=Textpike>
string sallys_number = m_delete(phonebook, "Sally Smart");
</source>