Gnus development mailing list
 help / color / mirror / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: ding@gnus.org
Subject: Re: `gnus-bound-and-true-p'
Date: Wed, 02 Nov 2011 22:09:32 +0100	[thread overview]
Message-ID: <pknfwi61bar.fsf@this.is.really.invalid> (raw)
In-Reply-To: <87ty6mz1ni.fsf@marauder.physik.uni-ulm.de>

Reiner Steib <reinersteib+gmane@imap.cc> 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




  reply	other threads:[~2011-11-02 21:09 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 ` `gnus-bound-and-true-p' Reiner Steib
2011-11-02 21:09   ` Robert Pluim [this message]
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=pknfwi61bar.fsf@this.is.really.invalid \
    --to=rpluim@gmail.com \
    --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).