Help us understand the problem. What is going on with this article?

初期化されていない可能性がある変数の真偽値で分岐

More than 5 years have passed since last update.

Elispで「変数が初期化されていて、かつその変数がnilでないとき」に処理を行いたいときはこんな感じで書ける。

(when (and (boundp 'var) var)
  body...)

(when var body) としてしまうと void-variable が発生するので注意。

zonkyy
EmacsとRubyが大好き
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away