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: why does `variable-at-point' return 0? Date: Fri, 6 Apr 2012 17:23:07 -0700 Message-ID: <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 1333758208 31472 80.91.229.3 (7 Apr 2012 00:23:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 7 Apr 2012 00:23:28 +0000 (UTC) To: Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 07 02:23:28 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 1SGJR4-0004b6-28 for ged-emacs-devel@m.gmane.org; Sat, 07 Apr 2012 02:23:22 +0200 Original-Received: from localhost ([::1]:39179 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SGJR2-00005k-Vz for ged-emacs-devel@m.gmane.org; Fri, 06 Apr 2012 20:23:20 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52125) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SGJQz-00005d-I3 for emacs-devel@gnu.org; Fri, 06 Apr 2012 20:23:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SGJQx-00054y-V5 for emacs-devel@gnu.org; Fri, 06 Apr 2012 20:23:17 -0400 Original-Received: from rcsinet15.oracle.com ([148.87.113.117]:50436) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SGJQx-00054j-Qv for emacs-devel@gnu.org; Fri, 06 Apr 2012 20:23:15 -0400 Original-Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q370NCAv002370 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 7 Apr 2012 00:23:13 GMT Original-Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q370NBTJ007095 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 7 Apr 2012 00:23:12 GMT Original-Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q370NBcK021045 for ; Fri, 6 Apr 2012 19:23:11 -0500 Original-Received: from dradamslap1 (/10.159.57.240) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 06 Apr 2012 17:23:11 -0700 X-Mailer: Microsoft Office Outlook 11 Thread-Index: Ac0UVJtOR6q4bXvmQQaFbC46q7vO1w== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-CT-RefId: str=0001.0A090205.4F7F88F1.0048,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:149444 Archived-At: 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?