タグ

2009年8月19日のブックマーク (2件)

  • elisp でハッシュ

    Perl ではハッシュ、Smalltalk では Dictionary (Javascript のオブジェクト、 STL の map) という便利なデータ構造があって、キーワードと値の組をセットで保存、 高速検索を行う事が出ます。elisp ではちょっと変な方法になっているので、 忘れないようにメモ。 簡単な使い方 まず、辞書(シンボルテーブル = キーの表)を作ります。 辞書は、長さが素数で値が全部 0 の配列が良いそうです。 (setq table (make-vector 3 0)) 辞書に登録 これで、table という表に、"パール" -> "Perl" の組を保存します。 (set (intern "パール" table) "Perl") 辞書を検索する。 table という表にある "パール" のキーを取り出します。 (symbol-value (intern-soft "パ

    khiker
    khiker 2009/08/19
    すごい発想。今はmake-hash-tableがあるけど、昔はなかった、という理解でいいんかな。
  • Debian Reference

    This Debian Reference (version 2.124) (2024-06-30 04:06:30 UTC) is intended to provide a broad overview of the Debian system as a post-installation user's guide. It covers many aspects of system administration through shell-command examples for non-developers. Abstract This book is free; you may redistribute it and/or modify it under the terms of the GNU General Public License of any version compl