unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* 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

only message in thread, other threads:[~2002-03-07 11:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20020307.084637.59481548.wl@gnu.org>
2002-03-07 11:14 ` variable type Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).