Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?

Getting Started Introduction A simple tutorial Language Reference Basic syntax Types Variables Constants Expressions Operators Control Structures Functions Classes and Objects Namespaces Enumerations Errors Exceptions Fibers Generators Attributes References Explained Predefined Variables Predefined Exceptions Predefined Interfaces and Classes Predefined Attributes Context options and parameters Su
いろいろな言語で、キーと値とを対応づけるデータ構造、いわゆる連想配列、辞書、……たちがどのように呼ばれているか、気になったので調べてみた。 おおよそ、対応表(map)、辞書(dictionary)、実装の名前をそのまま(hash-table)、 Perl風(hash)に分けられると思う。 Common Lisp: hash-table Scheme: hash-table (SRFI-69, SRFI-125 → R7RS-large), hashtable (R6RS Scheme, SRFI-126), map (SRFI-44), mapping (SRFI-146) Haskell: Map OCaml: Hashtbl, Map SML: hash_table (sml-nj-lib) C++: map, multimap, unordered_map, unordered_mu
プログラムを書いていると、入力値が辞書に含まれているかを調べたいようなことがあります。たとえば、ユーザーに都道府県名を入力させて、それが正しい都道府県名であるかどうかを調べたい、というようなことがあるかもしれません。 このような内容をPHPで書く際、キーに都道府県名を持つような連想配列を作る習慣がある人は多いはずです。これは典型的な連想配列の使い方といえるでしょう。 <?php $prefs = array( "北海道" => true, "青森" => true, // ... "沖縄" => true, ); if (isset($prefs[$input])) { // 都道府県名が正しい時の処理 } 一方で、in_array関数を使うやり方も考えられます。 <?php $prefs = array( "北海道", "青森", // ... "沖縄", ); if (in_array
The bash man page has long had the following bug listed: "It's too big and too slow" (at the very bottom of the man page). If you agree with that, then you probably won't want to read about the "new" associative arrays that were added in version 4.0 of bash. On the other hand, if you've ever used any modern Office Suite and seen code-bloat at its finest and just think the bash folks are exaggerati
すべての Microsoft 製品 Global Microsoft 365 Teams Copilot Windows Surface Xbox セール 法人向け サポート ソフトウェア Windows アプリ AI OneDrive Outlook Skype OneNote Microsoft Teams PC とデバイス Xbox を購入する アクセサリ VR & 複合現実 エンタメ Xbox Game Pass Ultimate Xbox とゲーム PC ゲーム Windows ゲーム 映画とテレビ番組 法人向け Microsoft Cloud Microsoft Security Azure Dynamics 365 一般法人向け Microsoft 365 Microsoft Industry Microsoft Power Platform Windows 365 開発者
連想配列(れんそうはいれつ、英語: associative array)とは、コンピュータプログラミングにおいて、添え字にスカラー数値以外のデータ型(文字列型等)も使用できる配列である。抽象データ型のひとつ。連想リスト、連想コンテナ、辞書(あるいはカタカナでディクショナリ 英語: dictionary)、ハッシュ(英語: hash)、マップ(英語: map)とも呼ばれる。 歴史的には、最初に LISP の連想リストとして広く認知された。その後、SNOBOL で table として、AWK で連想配列として実装したことで、その潜在能力がさらに広く知られるようになった。現在、Rubyなど一部の言語では、添え字にはどのようなデータでも使えるものもある。 プログラミングにおける単純な配列は、特定のアドレスからのオフセット(ずれ)をインデックスとして、アドレスとオフセットによって目的の値を得る。これ
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く