Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
質問したいのですが、elispでnilからゼロへのnil変換を行う関数は何ですか?
私は初心者で、コードを使って車輪の再発明をしていると思います。
(defun chgnull (x) (if (null x) 0 1)) (mapcar 'chgnull '(1 2 nil))
キーワード「tozero」でEmacsソースを検索しても、関連するものは何も表示されていません。
がnilの場合、式(or x 0)は0と評価され、それ以外の場合は評価されます。xx
(or x 0)
x