Change nil's to zeroes in elisp
Posted
by mageslayer
on Stack Overflow
See other posts from Stack Overflow
or by mageslayer
Published on 2010-05-25T16:38:12Z
Indexed on
2010/05/25
16:41 UTC
Read the original article
Hit count: 358
Hi all
I'd like to ask - what is the function doing nil conversion from nil's to zeroes in elisp?
I'm a newbie and I think I am inventing the wheel with my code:
(defun chgnull (x)
(if (null x) 0 1))
(mapcar 'chgnull '(1 2 nil))
Search through Emacs sources by keyword "to zero" and such haven't shown anything relevant.
© Stack Overflow or respective owner