Re: diff. betw. equal and eq on simbols



Thomas Schilling wrote:

So, that's the micro-performance perspective.

Yes, and after having dissected the performance issues of the various EQ, EQL and EQUAL operators, I think we should say something about a more important issue here: The use of these different operators also signals the programmer's intention, and that is what source code should mostly be concerned about.


If you use EQ you tell readers of your program that you don't expect to compare anything but just objects. If you use EQL you tell readers that you expect to also deal with numbers and characters. And so on. This will help readers of your code to make assumptions about the intent of the source code and ultimately to better understand it. If you always use the same generic operators (like EQUAL) the less information you reveal about your intentions.


Pascal

--
My website: http://p-cos.net
Closer to MOP & ContextL:
http://common-lisp.net/project/closer/
.



Relevant Pages

  • Re: diff. betw. equal and eq on simbols
    ... If you use EQL you tell readers that you expect to also deal with numbers and characters. ... This will help readers of your code to make assumptions about the intent of the source code and ultimately to better understand it. ...
    (comp.lang.lisp)
  • Re: diff. betw. equal and eq on simbols
    ... >> If you use EQ you tell readers of your program that you don't expect ... If you use EQL you tell ... > I almost never use eq, and therefore I'm not giving the programmer any ... > guarantees about symbols vs. characters vs. numbers etc. ...
    (comp.lang.lisp)