Changes

Jump to navigation Jump to search
293 bytes removed ,  12:14, 23 April 2011
no edit summary
|-
| valign='top' | '''Examples'''
|The expression <code>map:contains($week, 2)</code> returns <code>true()</code>.<br/>The expression <code>map:contains($week, 9)</code> returns <code>false()</code>.<br/>The expression <code>map:contains(map{}, "xyz")</code> returns <code>false()</code>.<br/>The expression <code>map:contains(map{ "xyz":=23 }, "xyz")</code> returns <code>true()</code>.<br/>
|}
|-
| valign='top' | '''Examples'''
| The expression <code>map:entry("M", "Monday")</code> creates a map <code>{ "M":="Monday" }</code> with a single entry.
|}
|-
| valign='top' | '''Examples'''
| The expression <code>map:get($week, 4)</code> returns <code>"Donnerstag"</code>.<br/>The expression <code>map:get($week, 9)</code> returns <code>()</code>. <em>(When the key is not present, the function returns an empty sequence.).</em><br/>The expression <code>map:get(map:entry(7,())), 7)</code> returns <code>()</code>. <em>(An empty sequence as the result can also signify that the key is present and the associated value is an empty sequence.).</em><br/>
|}
|-
| valign='top' | '''Examples'''
| The expression <code>map:keys(map{ 1:="yes", 2:="no" })</code> returns some permutation of <code>(1,2)</code> <em>(the result is in implementation-dependent order).</em><br/>
|}
|-
| valign='top' | '''Examples'''
| The expression <code>map:new()</code> creates an empty map.<br/>The expression <code>map:new(())</code> creates an empty map.<br/>The expression <code>map:new(map:entry(0, "no"), map:entry(1, "yes"))</code> creates a map with the values <code>{ 0:="no", 1:="yes" }</code>.<br/>The expression <code>map:new(map:entry(0, "no"), map:entry(1, "yes"))</code> creates a map with the values <code>{ 0:="no", 1:="yes" }</code>.<br/>The expression <code>map:new(($week, map{ 7:="Unbekannt" }))</code> creates a map with the values <code>{ 0:="Sonntag", 1:="Montag", 2:="Dienstag", 3:="Mittwoch", 4:="Donnerstag", 5:="Freitag", 6:="Samstag", 7:="Unbekannt" }</code>.<br/>The expression <code>map:new(($week, map{ 6:="Sonnabend" }))</code> creates a map with the values <code>{ 0:="Sonntag", 1:="Montag", 2:="Dienstag", 3:="Mittwoch", 4:="Donnerstag", 5:="Freitag", 6:="Sonnabend" }</code>.<br/>
|}
|-
| valign='top' | '''Examples'''
| The expression <code>map:remove($week, 4)</code> creates a map with the values <code>{ 0:="Sonntag", 1:="Montag", 2:="Dienstag", 3:="Mittwoch", 5:="Freitag", 6:="Samstag" }</code>.<br/>The expression <code>map:remove($week, 23)</code> creates a map with the values <code>{ 0:="Sonntag", 1:="Montag", 2:="Dienstag", 3:="Mittwoch", 4:="Donnerstag", 5:="Freitag", 6:="Samstag" }</code>.<br/>
|}
|-
| valign='top' | '''Examples'''
| The expression <code>map:size(map:new())</code> returns <code>0</code>.<br/> The expression <code>map:size(map{ "true":=1, "false":=0 })</code> returns <code>2</code>.<br/>
|}
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu