* Re: variable type
[not found] <20020307.084637.59481548.wl@gnu.org>
@ 2002-03-07 11:14 ` Eli Zaretskii
0 siblings, 0 replies; only message in thread
From: Eli Zaretskii @ 2002-03-07 11:14 UTC (permalink / raw)
Cc: emacs-devel
[Redirected to emacs-devel, where these issues should be discussed.]
On Thu, 7 Mar 2002, Werner LEMBERG wrote:
> How shall I define a variable which has the following properties:
>
> If nil, don't use it.
> If t, use value 0.
> If a positive integer, use it.
>
> My idea is to represent this in C as an integer where nil maps to -1.
I'd define it as a Lisp_Object, and then use NATNUMP, STRINGP, NILP, etc.
to see what its type and extract the value. Emacs sources do that quite
a lot.
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] only message in thread