GNU bug report logs -
#8670
OT: bug#8667: 24.0.50; `bounds-of-thing-at-point' returns (N . N) for `comment'
Previous Next
Reported by: "Drew Adams" <drew.adams <at> oracle.com>
Date: Fri, 13 May 2011 14:26:02 UTC
Severity: normal
Merged with 8667
Found in version 24.0.50
Done: "Drew Adams" <drew.adams <at> oracle.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 8670 in the body.
You can then email your comments to 8670 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#8670
; Package
emacs
.
(Fri, 13 May 2011 14:26:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
"Drew Adams" <drew.adams <at> oracle.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Fri, 13 May 2011 14:26:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
> > (Dunno why some people insist on using `(if (and...)
> > singleton)'. It gets in the way of readability and just
> > represents extra noise. Binary `if' is generally an
> > impediment to readability and communicating intention.)
>
> Readability is in the eye of the beholder, intention is in
> the mind of the author.
Which is why I said "readability AND communicating intention". And I said
"COMMUNICATING intention", not just "intention". Communicating involves both
the writer and the reader. If the writer's intent is to be communicated well
then readers need to be able to grasp it easily by reading.
> Personally, I think (if (and...) result) communicates the
> intent more clearly than (and ... result)
Really? What's the intent? The result of evaluating
(and A B C D E) is pretty clear: nil or E.
You write that which way? What does adding `if' do for you?
You can add `if' quite a bit, but what does it help?
(and A B C D E)
(if (and A B C D) E) - clearer?
(if (if (and A B C) D) E) - even clearer?
(if (if (if (and A B) C) D) E) - yet clearer?
(if (if (if (if A B) C) D) E) - clearest?
To each his own...
The problem with binary `if' is that it requires more careful parsing, to
distinguish a single sexp from two (2 sexps from 3). It can be pretty easy to
mistake a binary for a ternary `if', or vice versa, depending on the actual
argument sexps.
But if you know that a writer systematically uses:
(a) `when' and `unless' to indicate that the result is
unimportant/unused (only side effects matter),
(b) `if' only as ternary, never binary,
(c) `and' and `or' when args are to be eval'd in order
and the result is significant/used
then it is very quick to follow the code's meaning and author's intent. Coming
across a binary `if' in this context then raises a red flag. Of course, when
debugging a section of code that is problematic you must always double-check
that the writer actually respected the convention, but otherwise it's a breeze.
Is this a widespread convention? Yes and no. Many writers of Common Lisp
follow it; some (many?) do not. It helps when you pretty much know that the
writer follows it (e.g. when I read my own code). All bets are off if no
convention is followed wrt these functions.
Personally, I consider use of `if' when the result is not important, and use of
`when' or `unless' when the result matters, to be perverse. The other parts of
the convention are less important/useful, to me.
If you want to super-if-ify the Emacs source code, as above, feel free. Reduce
all uses of `and' to binary `and' if you want, or eliminate use of `and'
altogether.
Merged 8667 8670.
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Fri, 13 May 2011 16:47:02 GMT)
Full text and
rfc822 format available.
Did not alter fixed versions and reopened.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Thu, 19 May 2011 17:10:03 GMT)
Full text and
rfc822 format available.
Did not alter fixed versions and reopened.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Thu, 19 May 2011 17:20:03 GMT)
Full text and
rfc822 format available.
Did not alter fixed versions and reopened.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 21 May 2011 14:48:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sun, 19 Jun 2011 11:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 14 years and 61 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.