From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/80472 Path: news.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.gnus.general Subject: Re: `gnus-bound-and-true-p' Date: Wed, 02 Nov 2011 22:09:32 +0100 Organization: not if I can help it Message-ID: References: <87ty6mz1ni.fsf@marauder.physik.uni-ulm.de> Reply-To: ding@gnus.org NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1320268218 25184 80.91.229.12 (2 Nov 2011 21:10:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 2 Nov 2011 21:10:18 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M28757@lists.math.uh.edu Wed Nov 02 22:10:14 2011 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RLi4b-00042B-SG for ding-account@gmane.org; Wed, 02 Nov 2011 22:10:14 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1RLi4P-0005mg-Ai; Wed, 02 Nov 2011 16:10:01 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1RLi4N-0005mN-W9 for ding@lists.math.uh.edu; Wed, 02 Nov 2011 16:10:00 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1RLi4M-0000gu-WD for ding@lists.math.uh.edu; Wed, 02 Nov 2011 16:09:59 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1RLi4L-0005CB-KM for ding@gnus.org; Wed, 02 Nov 2011 22:09:57 +0100 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RLi4K-0003uh-Am for ding@gnus.org; Wed, 02 Nov 2011 22:09:56 +0100 Original-Received: from lns-bzn-49f-81-56-191-143.adsl.proxad.net ([81.56.191.143]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 02 Nov 2011 22:09:56 +0100 Original-Received: from rpluim by lns-bzn-49f-81-56-191-143.adsl.proxad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 02 Nov 2011 22:09:56 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: ding@gnus.org Original-Lines: 45 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: lns-bzn-49f-81-56-191-143.adsl.proxad.net Mail-Copies-To: never User-Agent: Gnus/5.110018 (No Gnus v0.18) XEmacs/21.5-b31 (cygwin32) Cancel-Lock: sha1:ybIfkuexFW8jPpOdfPXsT8U0Srw= X-Spam-Score: -5.2 (-----) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:80472 Archived-At: Reiner Steib writes: > On Tue, Nov 01 2011, Ted Zlatanov wrote: >> -(eval-when-compile >> - ;; This is unnecessary in the compiled version as it is a macro. >> - (if (fboundp 'bound-and-true-p) >> - (defalias 'gnus-bound-and-true-p 'bound-and-true-p) >> - (defmacro gnus-bound-and-true-p (var) >> - "Return the value of symbol VAR if it is bound, else nil." >> - `(and (boundp (quote ,var)) ,var)))) >> - >> -(defun gnus-bound-and-true-dumber-p (sym) >> +;; simple check, can be a macro but this way, although slow, it's really clear >> +(defun gnus-bound-and-true-p (sym) >> (and (boundp sym) (symbol-value sym))) > > On Wed, Nov 02 2011, Ted Zlatanov wrote: >> -;; simple check, can be a macro but this way, although slow, it's really clear >> +;; Simple check: can be a macro but this way, although slow, it's really clear. >> +;; We don't use `bound-and-true-p' because it's not in XEmacs. >> (defun gnus-bound-and-true-p (sym) >> (and (boundp sym) (symbol-value sym))) > > Can't you use an alias for Emacs and a macro for XEmacs? > > (if (fboundp 'bound-and-true-p) > (defalias 'gnus-bound-and-true-p 'bound-and-true-p) > (defmacro gnus-bound-and-true-p (var) > "Return the value of symbol VAR if it is bound, else nil." > `(and (boundp (quote ,var)) ,var))) Especially since in XEmacs 21.5: `bound-and-true-p' is a compiled Lisp macro -- loaded from "/build/xemacs-edge/lisp/subr.elc" (bound-and-true-p VAR) Documentation: Return the value of symbol VAR if it is bound, else nil. And: (fboundp 'bound-and-true-p) => t Robert