all messages for Emacs-related lists mirrored at yhetil.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.