From: Eli Bendersky
Subject: Re: a short article about equality in Lisp (for beginners)
Date:
Message-ID: <cf5o5f$24j@odak26.prod.google.com>
Pascal Costanza wrote:
> Eli Bendersky wrote:
>
> > I think it will be quite useful to beginners, both to understand
> > and to serve as a reference. But I'll be glad to get some feedback
from
> > the experienced Lisp programmers here. Are there
> > any obvious flops ?
>
> It's a very nice article and I think I will recommend it. However, a
> minor note: The last section before the Summary might lead some
newbies
> to try too hard to figure out when they should use eq instead of eql.
> It's possibly a good idea to say that eql is generally fast enough,
and
> that's why it is usually the default (and should be in one's own
code).
>
Well, I'm not sure. Using disassemble, eq seems quite a bit
simpler/faster than eql. It's basically just one comparison/branch. eql
is much more convoluted.
Eli Bendersky wrote:
> Well, I'm not sure. Using disassemble, eq seems quite a bit
> simpler/faster than eql. It's basically just one comparison/branch. eql
> is much more convoluted.
You don't know anything about the efficiency of a particular piece of
assembly code just by looking at it, no matter what it looks like. Much
less do you know how often it is actually used in a real application,
i.e. how it actually affects the overall efficiency of some program. I
don't think that a considerably large portion of the runtime of any
program is spent in equivalence predicates, except for benchmarks that
test equivalence predicates.
Pascal
--
Tyler: "How's that working out for you?"
Jack: "Great."
Tyler: "Keep it up, then."