[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: iff?
From: |
Jim Blandy |
Subject: |
Re: iff? |
Date: |
21 Apr 2001 19:24:24 -0500 |
Keith Wright <address@hidden> writes:
> I have a PhD in theoretical computer science, emphasis in logic,
> and I say it's not just clearer for the non-mathematical, but
> also for the very picky. If you say
>
> (null? x) returns #t iff x is the empty list
>
> you have said almost nothing about what it returns if x is
> not the empty list.
I'm probably responsible for most of the `iff' usage. In my own
defense, I usually say:
(foo x) returns true iff x is foo-like.
Since all values but #f are true, it's clear that the function must
return #f if x is not foo-like. As you point out, however, it doesn't
promise that (foo x) ever returns at all if x is not foo-like.
I've gotten questions about uses of `iff' in other contexts as well.
Given that it's not widely understood, and that the alternative
wording
(foo x) returns true if x is foo-like; otherwise, it returns
#f.
is:
- clear to a broad audience,
- more precise (since it guarantees termination no matter what x is), and
- not too much more verbose,
it seems to be the clearly preferable wording.
In Emacs, the first line of any docstring is supposed to be a
self-contained summary of the function's behavior. The `apropos'
commands take advantage of this, and show you the first line of each
matching command/function/variable's docstring. The appeal of `iff'
is that it is somewhat briefer, which sometimes allowed me to fit a
better description into that first line.
- iff?, Masao Uebayashi, 2001/04/20
- Re: iff?, Martin Grabmueller, 2001/04/20
- Re: iff?, thi, 2001/04/20
- Re: iff?, Yuk-Wah Wong, 2001/04/21
- Re: iff?, Neil Jerram, 2001/04/21
- Re: iff?, Yuk-Wah Wong, 2001/04/21
- Re: iff?, Keith Wright, 2001/04/21
- Re: iff?,
Jim Blandy <=
- Re: iff?, Rob Browning, 2001/04/24
- Re: iff?, Jim Blandy, 2001/04/24
- Re: iff?, Marius Vollmer, 2001/04/24
- Re: iff?, Rob Browning, 2001/04/25
- Re: iff?, Ivan Toshkov, 2001/04/25
- Re: iff?, Matthias Koeppe, 2001/04/25
- Re: iff?, Marius Vollmer, 2001/04/30
- Re: iff?, Jim Blandy, 2001/04/25
- Re: iff?, thi, 2001/04/27
Re: iff?, Florian Weimer, 2001/04/25