From: Reiner Steib <reinersteib+gmane@imap.cc>
To: ding@gnus.org
Subject: `gnus-bound-and-true-p'
Date: Wed, 02 Nov 2011 21:53:53 +0100 [thread overview]
Message-ID: <87ty6mz1ni.fsf@marauder.physik.uni-ulm.de> (raw)
In-Reply-To: <E1RLEn8-0001hI-O3@quimby.gnus.org>
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/
next parent reply other threads:[~2011-11-02 20:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E1RLEn8-0001hI-O3@quimby.gnus.org>
2011-11-02 20:53 ` Reiner Steib [this message]
2011-11-02 21:09 ` `gnus-bound-and-true-p' Robert Pluim
2011-11-02 21:55 ` `gnus-bound-and-true-p' Ted Zlatanov
2011-11-02 22:48 ` `gnus-bound-and-true-p' Dave Abrahams
2011-11-02 23:51 ` `gnus-bound-and-true-p' Ted Zlatanov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ty6mz1ni.fsf@marauder.physik.uni-ulm.de \
--to=reinersteib+gmane@imap.cc \
--cc=Reiner.Steib@gmx.de \
--cc=ding@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).