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

Content deleted Content added
m leds fix
Line 749:
Definition:
<syntaxhighlight lang="ksh">
typeset -A phonebook; # ksh93; in bash4+, "typeset" is a synonym of the more preferred "declare", which works identically in this case
phonebook=(["Sally Smart"]="555-9999" ["John Doe"]="555-1212" ["[[J. Random Hacker]]"]="555-1337");
declare -A phonebook; # bash4
phonebook=(["Sally Smart"]="555-9999" ["John Doe"]="555-1212" ["[[J. Random Hacker]]"]="555-1337");
</syntaxhighlight>
 
Dereference:
<syntaxhighlight lang="ksh">
${phonebook["John Doe"]};
</syntaxhighlight>