From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: hash-table-{to, from}-alist Date: Fri, 31 Jul 2009 15:03:48 -0400 Message-ID: References: <863aknitfg.fsf@lifelogs.com> <867i6tt4yz.fsf@lifelogs.com> <87bpw4k1z6.fsf@xemacs.org> <86bpw3d829.fsf@lifelogs.com> <87k5ari5jh.fsf@xemacs.org> <86prkiiia2.fsf@lifelogs.com> <86ej0ygr5j.fsf@lifelogs.com> <861vwygpc6.fsf@lifelogs.com> <868wqzd06x.fsf@lifelogs.com> <867i6hrrh9.fsf@lifelogs.com> <86prk8q8yn.fsf@lifelogs.com> <87eiry58qs.fsf@jumptrading.com> <87skge2dm6.fsf@stupidchicken.com> <87ab2m562t.fsf@lifelogs.com> <871vnyot6m.fsf@stupidchicken.com> <87iqh84uao.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1249067050 14728 80.91.229.12 (31 Jul 2009 19:04:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 31 Jul 2009 19:04:10 +0000 (UTC) Cc: emacs-devel@gnu.org To: Ted Zlatanov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 31 21:04:03 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 1MWxOa-0005ms-MM for ged-emacs-devel@m.gmane.org; Fri, 31 Jul 2009 21:04:01 +0200 Original-Received: from localhost ([127.0.0.1]:37432 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MWxOa-0003f0-51 for ged-emacs-devel@m.gmane.org; Fri, 31 Jul 2009 15:04:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MWxOV-0003ev-RM for emacs-devel@gnu.org; Fri, 31 Jul 2009 15:03:55 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MWxOQ-0003dZ-EB for emacs-devel@gnu.org; Fri, 31 Jul 2009 15:03:54 -0400 Original-Received: from [199.232.76.173] (port=34690 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MWxOQ-0003dW-8W for emacs-devel@gnu.org; Fri, 31 Jul 2009 15:03:50 -0400 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]:58474 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MWxOP-0004nN-PY for emacs-devel@gnu.org; Fri, 31 Jul 2009 15:03:49 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsEFAIfcckpFpZgv/2dsb2JhbACBUtJHhBgFgUqFWA X-IronPort-AV: E=Sophos;i="4.43,303,1246852800"; d="scan'208";a="42638198" Original-Received: from 69-165-152-47.dsl.teksavvy.com (HELO pastel.home) ([69.165.152.47]) by ironport2-out.teksavvy.com with ESMTP; 31 Jul 2009 15:03:49 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id B1DA6800B; Fri, 31 Jul 2009 15:03:48 -0400 (EDT) In-Reply-To: <87iqh84uao.fsf@lifelogs.com> (Ted Zlatanov's message of "Fri, 31 Jul 2009 12:49:19 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:113478 Archived-At: SM> Of, course there's always another (more reliable) way: SM> (hash-table-p (read-from-string (prin1-to-string (make-hash-table)))) > That was my first thought, but it seemed like a really hacky approach > when featurep exists. It's definitely not hacky. It's more reliable (tho it probably requires a bit of fiddling such as wrapping it in ignore-errors) and tests more directly the presence of the feature you need. The advantage of the featurep call is that it's likely to be more efficient (which only matters if the test is made within a loop, of course). Stefan