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: keywordp & :killing-the-cat Date: Sat, 5 Sep 2009 14:14:46 -0700 Message-ID: <9C86F0EAC52544628CBA55A43FF2F935@us.oracle.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1252185313 25550 80.91.229.12 (5 Sep 2009 21:15:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 5 Sep 2009 21:15:13 +0000 (UTC) To: "'MON KEY'" , Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 05 23:15:06 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Mk2b8-00032D-BR for ged-emacs-devel@m.gmane.org; Sat, 05 Sep 2009 23:15:02 +0200 Original-Received: from localhost ([127.0.0.1]:45378 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mk2b7-0007R6-Jm for ged-emacs-devel@m.gmane.org; Sat, 05 Sep 2009 17:15:01 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mk2b2-0007Qz-5o for emacs-devel@gnu.org; Sat, 05 Sep 2009 17:14:56 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mk2ax-0007QF-Ru for emacs-devel@gnu.org; Sat, 05 Sep 2009 17:14:55 -0400 Original-Received: from [199.232.76.173] (port=44526 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mk2ax-0007Q9-KD for emacs-devel@gnu.org; Sat, 05 Sep 2009 17:14:51 -0400 Original-Received: from rcsinet11.oracle.com ([148.87.113.123]:26856 helo=rgminet11.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mk2aw-0004ye-Px for emacs-devel@gnu.org; Sat, 05 Sep 2009 17:14:51 -0400 Original-Received: from rgminet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rgminet11.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n85LFIPt022451 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 5 Sep 2009 21:15:19 GMT Original-Received: from abhmt002.oracle.com (abhmt002.oracle.com [141.146.116.11]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n85LEhfT007376; Sat, 5 Sep 2009 21:14:43 GMT Original-Received: from dradamslap1 (/141.144.224.66) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 05 Sep 2009 14:14:42 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Thread-Index: AcouaOeRo/xnKbICSZ+SxvStj3X7mwAA9KpQ X-Source-IP: abhmt002.oracle.com [141.146.116.11] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090207.4AA2D4C2.01B1:SCFSTAT5015188,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:115058 Archived-At: > (keywordp :killing-the-cat-with-epr) ;=> t > (unintern :killing-the-cat-with-epr) ;=> t > > (mapatoms (lambda (x) > (when (eq x :killing-the-cat-with-epr) > (prin1 `(found ,x)))) > obarray) Evaluating (actually, Lisp reading) that sexp creates and interns a symbol `:killing-the-cat-with-epr'. Try this instead: (mapatoms (lambda (x) (when (string= (symbol-name x) ":killing-the-cat-with-epr") (prin1 `(found ,x)))) obarray) Replace ":killing-the-cat-with-epr" by the name of an existing symbol, e.g. "forward-char", to see the difference. > how does one use keywordp to test if a (possibly > non-existent) keyword is interned without interning it? You don't use keywordp for that. keywordp: Return t if OBJECT is a keyword. This means that it is a symbol with a print name beginning with `:' interned in the initial obarray. IOW, keywordp returns non-nil only for an interned symbol (whose print name starts with `:'). If you want to check whether a symbol is interned, use `intern-soft': (intern-soft ":killing-the-cat-with-epr") -> nil (intern-soft "forward-char") -> forward-char