From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: why does `variable-at-point' return 0? Date: Mon, 16 Apr 2012 11:07:47 -0700 Message-ID: <717003EF5A184D8A91EF489C3A79EB92@us.oracle.com> References: <2F0E226322EE44669007194BC8389F81@us.oracle.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1334599680 22273 80.91.229.3 (16 Apr 2012 18:08:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 16 Apr 2012 18:08:00 +0000 (UTC) To: Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 16 20:07:59 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SJqLG-00049k-R1 for ged-emacs-devel@m.gmane.org; Mon, 16 Apr 2012 20:07:58 +0200 Original-Received: from localhost ([::1]:43186 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SJqLF-00037B-Uj for ged-emacs-devel@m.gmane.org; Mon, 16 Apr 2012 14:07:57 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52445) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SJqLC-00035H-R5 for emacs-devel@gnu.org; Mon, 16 Apr 2012 14:07:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SJqLB-0000zc-41 for emacs-devel@gnu.org; Mon, 16 Apr 2012 14:07:54 -0400 Original-Received: from rcsinet15.oracle.com ([148.87.113.117]:20016) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SJqLA-0000yT-TV for emacs-devel@gnu.org; Mon, 16 Apr 2012 14:07:53 -0400 Original-Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q3GI7nRn009100 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 16 Apr 2012 18:07:50 GMT Original-Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q3GI7mQP008979 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 16 Apr 2012 18:07:49 GMT Original-Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q3GI7mFX022055 for ; Mon, 16 Apr 2012 13:07:48 -0500 Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 16 Apr 2012 11:07:47 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <2F0E226322EE44669007194BC8389F81@us.oracle.com> Thread-Index: Ac0UVJtOR6q4bXvmQQaFbC46q7vO1wHpv5WA X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-CT-RefId: str=0001.0A090206.4F8C5FF6.008D,ss=1,re=0.000,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 148.87.113.117 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:149698 Archived-At: ping > Just curious. Why doesn't `variable-at-point' return nil if > there is no variable at point? > > All I can think of is that for some reason someone wanted to > test using `symbolp' instead of testing using `not' (or `and'). > But I cannot imagine why. > > Checking how `variable-at-point' is actually used in the > source code did not enlighten me. Each use just checks whether > the value is `symbolp' and goes on from there. An actual value > of zero is never used AFAICT, except to serve as a non-symbol. > > There is no special need to distinguish nil from any variable - in > Emacs Lisp you cannot give the symbol nil a symbol-value other than nil. > > It is true that (boundp nil) is true, so `boundp' is not a > test of variableness. But I don't see why it wouldn't be just as > easy to test whether the value is nil instead of testing whether it > is a symbol. What am I missing?