[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: DocView AutoFitting via "doc-view-autofit-mode"
From: |
Drew Adams |
Subject: |
RE: DocView AutoFitting via "doc-view-autofit-mode" |
Date: |
Mon, 2 Apr 2012 11:37:27 -0700 |
> > 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.
- Re: DocView AutoFitting via "doc-view-autofit-mode", Tassilo Horn, 2012/04/01
- Re: DocView AutoFitting via "doc-view-autofit-mode", Moritz Maxeiner, 2012/04/02
- RE: DocView AutoFitting via "doc-view-autofit-mode",
Drew Adams <=
- Re: DocView AutoFitting via "doc-view-autofit-mode", Tassilo Horn, 2012/04/02
- Re: DocView AutoFitting via "doc-view-autofit-mode", Stefan Monnier, 2012/04/03
- Re: DocView AutoFitting via "doc-view-autofit-mode", Moritz Maxeiner, 2012/04/03
- Re: DocView AutoFitting via "doc-view-autofit-mode", Stefan Monnier, 2012/04/03
- Re: DocView AutoFitting via "doc-view-autofit-mode", Moritz Maxeiner, 2012/04/03
- Re: DocView AutoFitting via "doc-view-autofit-mode", Stefan Monnier, 2012/04/03
- Re: DocView AutoFitting via "doc-view-autofit-mode", Stefan Monnier, 2012/04/25
- Re: DocView AutoFitting via "doc-view-autofit-mode", Tassilo Horn, 2012/04/03