From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/80471 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.gnus.general Subject: `gnus-bound-and-true-p' Date: Wed, 02 Nov 2011 21:53:53 +0100 Message-ID: <87ty6mz1ni.fsf@marauder.physik.uni-ulm.de> References: Reply-To: Reiner Steib NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1320267320 18336 80.91.229.12 (2 Nov 2011 20:55:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 2 Nov 2011 20:55:20 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M28756@lists.math.uh.edu Wed Nov 02 21:55:15 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 1RLhq6-0004KW-G1 for ding-account@gmane.org; Wed, 02 Nov 2011 21:55: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 1RLhpK-0005fk-4p; Wed, 02 Nov 2011 15:54:26 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1RLhpI-0005fT-6y for ding@lists.math.uh.edu; Wed, 02 Nov 2011 15:54:24 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1RLhpG-0001qX-9d for ding@lists.math.uh.edu; Wed, 02 Nov 2011 15:54:23 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1RLhpE-0004r3-7N for ding@gnus.org; Wed, 02 Nov 2011 21:54:20 +0100 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RLhpD-0003qw-W7 for ding@gnus.org; Wed, 02 Nov 2011 21:54:20 +0100 Original-Received: from p57946689.dip.t-dialin.net ([87.148.102.137]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 02 Nov 2011 21:54:19 +0100 Original-Received: from Reiner.Steib by p57946689.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 02 Nov 2011 21:54:19 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: ding@gnus.org Original-Lines: 34 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: p57946689.dip.t-dialin.net X-Face: mtjf/D:es1T0wHO:&CJ'ZXe"l;3C--rw\z!{`eFwL){|]RpI+4{u25L=5C /0>KuGeTsk<~<&NE-AKV1560e!+RJeyWmSskkrJm?[vUV#66{T_m|Ae<||Ku#Mk5`y&O`n~z2;n8eP J5#2h@2eQgV@E70IY_0WlEx!"&giy{+\%h1LJox$zv@/l%ZmU4^tZA>xQpnkUBVC5.jpg#0'(+2?Rs )NAr:>3<=WxHE$ktbLysDIM5TbmHu*3 Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:80471 Archived-At: 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))) Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/