all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Moritz Maxeiner'" <moritzmaxeiner@googlemail.com>,
	"'Tassilo Horn'" <tassilo@member.fsf.org>
Cc: emacs-devel@gnu.org
Subject: RE: DocView AutoFitting via "doc-view-autofit-mode"
Date: Mon, 2 Apr 2012 11:37:27 -0700	[thread overview]
Message-ID: <471DCFCA4EBC4643BDE6B942ADCF2ED8@us.oracle.com> (raw)
In-Reply-To: <4F79E8D5.8080701@googlemail.com>

> > Compare symbols with `eq'
> 
> Done, but any specific reason for that? `equal's doc-string 
> states that symbols must match exactly,
> so in the specific event of symbols, don't equal and eq 
> behave the same?

My take on this minor part of your post:

1. Yes, for a symbol, equal and eq act the same.  (Depending on the
implementation there could be a teeny tiny difference in performance.)

2. I use eq for symbol comparison if either (a) the code is sure that both args
are symbols or (b) I want it to behave as if it were sure (e.g. raise an error
if either is not a symbol).

#2 means that the source code indicates my intention.  If a human reader sees eq
then s?he knows that the code is expecting a symbol and will raise an error if
the expectation is not satisfied.  If s?he sees equal she can expect that (a)
the code might not be sure to receive symbols as both args and (b) the code
wants to return non-nil for any two equal objects.

IOW, my use of equal vs eq for expected symbol args is more about what happens
if either of the args is for some reason _not_ a symbol.




  reply	other threads:[~2012-04-02 18:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-31  0:24 DocView AutoFitting via "doc-view-autofit-mode" Moritz Maxeiner
2012-04-01  9:34 ` Tassilo Horn
2012-04-02 17:58   ` Moritz Maxeiner
2012-04-02 18:37     ` Drew Adams [this message]
2012-04-02 18:41     ` Tassilo Horn
2012-04-03 13:34     ` Stefan Monnier
2012-04-03 13:38       ` Moritz Maxeiner
2012-04-03 14:51         ` Stefan Monnier
2012-04-03 15:11           ` Moritz Maxeiner
2012-04-03 16:14             ` Stefan Monnier
2012-04-26  3:19               ` Stefan Monnier
2012-04-03 15:18           ` Tassilo Horn

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=471DCFCA4EBC4643BDE6B942ADCF2ED8@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=moritzmaxeiner@googlemail.com \
    --cc=tassilo@member.fsf.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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.