XEmacs and APEL

Katsumi Yamaoka yamaoka @ jpl.org
2002年 7月 25日 (木) 08:43:14 JST


>>>>> In [apel-ja : No.00704]
>>>>>	Shuhei KOBAYASHI <shuhei @ aqua.ocn.ne.jp> wrote:

小林さん> [apel-ja:00701] を書いた時にも自覚したし, 3 年前に pym.el を
小林さん> 分離した時

小林さん> | ;;; pym.el --- Macros for Your Poe.

小林さん> と書いたように, 私は *-maybe は APEL のためのものであるとい
小林さん> う意識が強いみたいです.

今ではそうなんだろうなと思います。いっそ、最近あちこちで はやっ
ている global ではない obarray を使うとか。:-p

小林さん> ところが世の中では

小林さん>> "Use `*-maybe' only when you exactly know what you are doing!"
小林さん>> ↑こう思われていないことが問題なのね.

山岡> さよう、いつでも使える便利なマクロ。:-p

小林さん> と期待されているみたいですね. 実際, FreeBSD ports を適当に入
小林さん> れたsite-lisp の中で grep を実行してみましたが, 色々出てきま
小林さん> すねぇ...

> bitmap/x-face-mule.el:  (defun byte-compile-file-form-defun-maybe (form)

小林さん> 深く追ってはいませんが, byte-compile-file-form-defun-maybe 
小林さん> とは...
小林さん> 何か禁断の技に手を出しているのですか?

x-face-mule 以外でも使っているのですが、名前 (もしくはやり方) が
適切ではありませんね。これは defun-maybe で定義した関数が、古い
Emacsen ではそれ以後の byte-compile で

** the function foo is not known to be defined.

と警告されてしまうので、単に byte-compile-function-environment
に登録するだけのものです。

> skk/skk-macs.el:(put 'ignore-errors 'defmacro-maybe t)

[...パス...]

小林さん> docstring をこのままにしてあった責任を取って, ここはひとつ, 
小林さん> 実際の動作をdocstring に合わせてしまいましょうか;-)

> (defvar def*-maybe-enable-compile-time-hack nil
>   "If non-nil, `def*-maybe' macros will do compile-time check.
> `def*-maybe' macro normally checks existence of its target function or
> variable at load-time.  But if this variable is non-nil at compile-time,
> existence of its target is first checked at compile-time, and if exists,
> it will emit no compiled code at all!
> You should set this variable to non-nil only when you really know what
> you are doing.")

おお、まさに似たようなことを考えていました。でもこっちの方が良い
なあ。ぼくが漠然と考えていたのは、APEL を `make dynamic' とかす
ると load-time check 型の def*-maybe を持った APEL が出来る、と
いうものでした。

小林さん> def*-maybe-enable-compile-time-hack を APEL の installer の
小林さん> 中でだけ non- nil に設定すれば APEL の中では今まで通り,
小林さん> XEmacs Packages では APEL のinstaller を使わないはずなので問
小林さん> 題なし, APEL 以外で使われている *-maybeは期待通り(?)に load
小林さん> 時のみ test を行なうことになりますがどうでしょうか?

とても良いと思います。ただ、def*-maybe はそのままにして、新たに
def*-when-void を作るというのも捨て難いです。
-- 
Katsumi Yamaoka <yamaoka @ jpl.org>




More information about the APEL-ja mailing list