[Common Lisp] 関数が定義されているか

シンボルに対応する関数が定義されているかは fboundp 関数で調べる。 CL-USER> (defun foo (x y) (+ x y)) FOO CL-USER> (fboundp ‘foo) T CL-USER> (fboundp ‘bar) NIL


Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 383
Posted in コンピュータ | Tagged , | Leave a reply

[Common Lisp] intern と symbol-name

intern は印字名に対応するシンボルを得る関数。 逆に、シンボルの印字名を得るには symbol-name 関数を用いる。 下の concat-symbol は「2つのシンボルの各印字名を連結した印字名をもつシンボル」を返す関数。 (defun concat-symbol (x y) (intern (concatenate ‘string (symbol-name x) (symbol-name y)))) CL-USER> (concat-symbol ‘x ‘y) XY NIL


Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 383
Posted in コンピュータ | Tagged , , | Leave a reply

[Common Lisp] リストの複製

毎回忘れて再発明しそうになるが、Common Lisp にはリストを複製する関数 copy-tree がある。 CL-USER> (let ((lst ‘(a b c))) (eq lst (copy-tree lst))) NIL


Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 383
Posted in コンピュータ | Tagged , | Leave a reply

[Common Lisp] コマンドライン引数を取得

Common Lisp ではコマンドライン引数を取得する方法は処理系依存らしい。 Steel Bank Common Lisp (SBCL) の場合は *posix-argv* に文字列のリストの形で代入されている。 Allegro Common Lisp (ACL) の場合は system パッケージの command-line-arguments 関数で取得できる。 『KMRCLを眺める(184) COMMAND-LINE-ARGUMENTS』 によると、(apropos ‘argv) として ‘argv で関数の説明文を検索すれば処理系毎の方法が見つかることが多いとのこと。


Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 383
Posted in コンピュータ | Tagged , , | Leave a reply

[SpamAssassin] mbox形式のメールで学習

mbox形式で保存されたメールを学習で用いるには、 sa-learn に –mbox オプションを指定する。 % sa-learn –mbox –spam smapfile Learned tokens from 228 message(s) (228 message(s) examined)


Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 383
Posted in コンピュータ | Tagged , , | Leave a reply

[Subversion] proxy経由でcheckoutする

Subversionで、HTTPプロトコルを用いてプロキシ経由でチェックアウトしたい。 What if I’m behind a proxy? – Subversion FAQ によると、.subversion/servers を編集すればよいよう。 .subversion/servers の先頭に設定の説明があって、 ### http-proxy-host Proxy host for HTTP connection ### http-proxy-port Port number of proxy host service ### http-proxy-username Username for auth to proxy service ### http-proxy-password Password Continue reading [Subversion] proxy経由でcheckoutする


Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 383
Posted in コンピュータ | Tagged , | Leave a reply

[FreeBSD] portsを検索

ports から目的の port を探すには ports-mgmt/psearch が便利。 % psearch [options] PATTERN [PATTERN…] とすることで、正規表現 PATTERN で ports 内を検索し、結果をリストアップしてくれる。 デフォルトでは port の名前(name)と短縮説明(short description)を検索するが、-s オプションを付けることで、詳細な説明(long description)内も検索するようになる。 -c オプションでカテゴリを指定。-n オプションでバージョンも含む、その port の正式名称を出力する。


Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 383
Posted in コンピュータ | Tagged , , | Leave a reply

[Cプリプロセッサ] マクロ引数の文字列化

C言語のプリプロセッサにおいて、引数付きマクロの引数を文字列化したいときがある。 たとえば、 int variable = 1; DEBUG_PRINT(variable); とすると、 printf(“%s is %d”, “variable”, 1); のように置換されるマクロを定義したい場合。 #define DEBUG_PRINT(x) printf(“%s is %d”, “x”, 1) としても、 printf(“%s is %d”, “x”, 1); と出力されてしまい、望む結果が得られない。 このようなときは、引数の文字列化機能を使用する。 引数名の先頭に`#’をつけることで、引数の文字列定数表現を得ることができる。 上の例の場合は次のようにする。 #define DEBUG_PRINT(x) printf(“%s is %d”, #x, x) 参考 The Continue reading [Cプリプロセッサ] マクロ引数の文字列化


Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 383
Posted in コンピュータ | Tagged , , | Leave a reply

[FreeBSD] ldap.confの場所

ports から pam_ldap や nss_ldap を入れた場合、openldap-client が自動で入る。 pam_ldap 用の ldap.conf.dist が/usr/local/etc にできるので、これを /usr/local/etc/ldap.conf にコピーして設定したが、ldapsearch などに反映されず、嵌った。 man ldap.conf によると、openldap-client の見る ldap.conf の場所は /usr/local/etc/openldap/ldap.conf だった。 要注意。


Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 383
Posted in コンピュータ | Tagged , , | Leave a reply

[FreeBSD 8.0] packages から X.org をインストール

OSインストール時のディストリビューション選択でXを選択せず,後で ports や packages からインストールするときの話。 パッケージ名がころころ変わるので今のところのやり方を書いておく。 以下のようにする # pkg_add -r xorg


Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 383
Posted in コンピュータ | Tagged , | Leave a reply