Skip to content

Instantly share code, notes, and snippets.

@leque
Last active August 29, 2015 14:01
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save leque/c7f694f25f593c4173a5 to your computer and use it in GitHub Desktop.
Save leque/c7f694f25f593c4173a5 to your computer and use it in GitHub Desktop.

各言語での Map, Dictionary 的なものの名前

CommonLisp:

hash-table

Scheme:

hash-table (SRFI-69), hashtable (R6RS Scheme)

Haskell:

Map

OCaml:

Hashtbl, Map

SML:

hash_table (sml-nj-lib)

C++:

map, multimap, unordered_map, unordered_multimap

Java:

Map, HashMap, Hashtable, LinkedHashMap, TreeMap, WeakHashMap, ...

Scala:

Map, HashMap, ListMap, SortedMap, TreeMap, LinkedHashMap, MultiMap, OpenHashMap, WeakHashMap, ...

ECMAScript:

Object

Perl:

hash [ProgrammingPerl2nd]

Ruby:

Hash

Smalltalk:

Dictionary

Python:

dict

PHP:

array

See also: syntax across languages per category / dictionary

ProgrammingPerl2nd

『プログラミング Perl 改訂版』(Larry Wall, Tom Christiansen, Randal L. Schwartz 共著、近藤嘉雪訳、オライリー・ジャパン、 1997) p.8 ではハッシュという名前の由来について以下のように解説している: 『そのためハッシュは「連想配列」(associative array)と呼ばれることもある。しかし、これは怠惰なタイピストにとったタイプするのが面倒だし、頻繁に使われるので、私たちはもっと短かくて、ぴりっとした(snappy)呼び名を付けることにしたのだ。「ハッシュ」という名前を選んだ別の理由は、中身が順番付けされていないことを強調するためである(ハッシュは、内部的にはハッシュ表を使って実装されている。ハッシュに値をどんなにたくさん格納しても、動作が速いのは、ハッシュ表のおかげである)。』

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment