[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: variable type

From: Eli Zaretskii
Subject: Re: variable type
Date: Thu, 7 Mar 2002 13:14:16 +0200 (IST)

[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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]