From mboxrd@z Thu Jan 1 00:00:00 1970 Path: quimby.gnus.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: variable type Date: Thu, 7 Mar 2002 13:14:16 +0200 (IST) Message-ID: NNTP-Posting-Host: quimby2.netfonds.no Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: quimby2.netfonds.no 1015500348 6638 195.204.10.66 (7 Mar 2002 11:25:48 GMT) X-Complaints-To: usenet@quimby2.netfonds.no NNTP-Posting-Date: 7 Mar 2002 11:25:48 GMT Cc: emacs-devel@gnu.org Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby2.netfonds.no with esmtp (Exim 3.12 #1 (Debian)) id 16iw1r-0001iy-00 for ; Thu, 07 Mar 2002 12:25:48 +0100 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.33 #1 (Debian)) id 16ivuO-0007xV-00; Thu, 07 Mar 2002 06:18:04 -0500 Original-Received: from is.elta.co.il ([199.203.121.2]) by fencepost.gnu.org with esmtp (Exim 3.33 #1 (Debian)) id 16ivrZ-0007pq-00; Thu, 07 Mar 2002 06:15:09 -0500 Original-Received: from is (is [199.203.121.2]) by is.elta.co.il (8.9.3/8.8.8) with SMTP id NAA10276; Thu, 7 Mar 2002 13:14:16 +0200 (IST) X-Sender: eliz@is Original-To: Werner LEMBERG In-Reply-To: <20020307.084637.59481548.wl@gnu.org> Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.5 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: quimby.gnus.org gmane.emacs.devel:1777 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:1777 [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