Associative array/Creation: Difference between revisions

m
Categorizing programming examples
No edit summary
m (Categorizing programming examples)
Line 5:
 
==[[C plus plus|C++]]==
[[Category:C plus plus]]
'''Compiler:''' g++ 4.0.2
 
Line 48 ⟶ 49:
 
==[[Java]]==
[[Category:Java]]
 
===Defining a Map===
Line 77 ⟶ 79:
 
==[[OCaml]]==
[[Category:OCaml]]
 
A simple idiom to create a hash table mapping strings to integers:
 
Line 93 ⟶ 95:
 
==[[Perl]]==
[[Category:Perl]]
'''Interpeter:''' Perl
 
Line 139 ⟶ 142:
 
==[[Python]]==
[[Category:Python]]
 
In Python, hashes are called dictionaries.
 
Line 166 ⟶ 169:
 
==[[Ruby]]==
[[Category:Ruby]]
A hash object that returns [[nil]] for unknown keys
hash={}