Re: diff. betw. equal and eq on simbols




Nikola Skoric wrote:
> I've been reading "COMMON LISP: A Gentle Introduction to Symbolic
> Computation" by David S. Touretzky, and came across a section where he
> describes difference between eq and equal. And, says "Due to its greater
> efficiency, programmers often use EQ instead of EQUAL when symbols are
> being compared." Now, why would eq be more efficient than equal when
> comparing only one symbol?

eq is generally more effecient than equal. However, as it compares
actual memory addresses of the two objects, it has a much stricter
definition of equality to equal, so you should only use it when you
want to compare symbols, or check that two things are the *same* object.

.



Relevant Pages

  • Re: Downside to Methanol
    ... That 37% is about twice the efficiency of an internal combustion engine, ... You are also comparing the optimum peak PEM output with a plain old ICE ... Efficiency over the power curve of PEM will not be the optimum. ... "We need an energy policy that encourages consumption" ...
    (sci.energy.hydrogen)
  • Re: Most efficient way of adding to a list?
    ... > better to define it with defparameter from the start). ... > and that's what got me thinking about efficiency in the first place. ... scan/traversal of your items list comparing each element to the new ... My real e-mail is ...
    (comp.lang.lisp)
  • Re: diff. betw. equal and eq on simbols
    ... >>> efficiency, programmers often use EQ instead of EQUAL when symbols are ... >>> comparing only one symbol? ... I'll get myself a interpreter which will be smart enough to check ...
    (comp.lang.lisp)
  • Re: diff. betw. equal and eq on simbols
    ... Computation" by David S. Touretzky, and came across a section where he describes difference between eq and equal. ... why would eq be more efficient than equal when comparing only one symbol? ... The loss of efficiency is due to the overhead spent on the type tests. ...
    (comp.lang.lisp)
  • Re: Geared unicycles? Old hat
    ... >I don't know what they're comparing the efficiency to. ... >comparing it to an automatic automobile transmission ... Note how they say powertrain SYSTEM efficiency. ...
    (rec.sport.unicycling)