[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: To `boundp' or not to `boundp'?
From: |
Drew Adams |
Subject: |
RE: To `boundp' or not to `boundp'? |
Date: |
Tue, 1 Sep 2015 11:00:23 -0700 (PDT) |
> > If they really wanted a macro for this, it should have been called
> > something that reflects what it does, e.g., `var-value-or-nil' or
> > `if-bound-then-value-else-nil'.
>
> One needs this quite often, so it's good to factor it out.
And so it was. I'm not convinced it helps. But if it helps you, great.
(and (boundp 'VAR) VAR) works for me.
> I've no strong opinion about the name, but I guess the macro was indeed
> intended for cases where the return value is used as a boolean. There
> are other use cases where the name then is confusing. Maybe
> `symbol-value-safe' in analogy to `car-safe' would be better? Then it
> would have to be a function, though.
I don't see why it would have to be a function, just due to a name
change. But the name is what it is, and likely won't be changed.
(And whatever the name, I will likely use (and (boundp 'VAR) VAR).)
- To `boundp' or not to `boundp'?, Alexander Shukaev, 2015/09/01
- Re: To `boundp' or not to `boundp'?, Dmitry Gutov, 2015/09/01
- Message not available
- Re: To `boundp' or not to `boundp'?, Barry Margolin, 2015/09/01
- RE: To `boundp' or not to `boundp'?, Drew Adams, 2015/09/01
- member returns list (was: Re: To `boundp' or not to `boundp'?), Emanuel Berg, 2015/09/01
- RE: member returns list (was: Re: To `boundp' or not to `boundp'?), Drew Adams, 2015/09/01
- Re: member returns list (was: Re: To `boundp' or not to `boundp'?), Emanuel Berg, 2015/09/01
- RE: member returns list (was: Re: To `boundp' or not to `boundp'?), Drew Adams, 2015/09/01
- Re: member returns list (was: Re: To `boundp' or not to `boundp'?), Emanuel Berg, 2015/09/01
- RE: member returns list (was: Re: To `boundp' or not to `boundp'?), Drew Adams, 2015/09/02
- Re: member returns list (was: Re: To `boundp' or not to `boundp'?), Emanuel Berg, 2015/09/02
- Message not available
- Re: member returns list, Pascal J. Bourguignon, 2015/09/03