Re: using compare
- Posted by jiri babor <jbabor at PARADISE.NET.NZ> Nov 15, 1998
- 504 views
David, This morning, after I saw your testy response to my impulsive last night note, I went back and checked it again. It sounds stupid now. You must know I did not mean to imply anything else than what it says. Compare tests do take at least twice as long as a simple equality test, but it is really a very small difference, unless it happens in an innermost loop of a frequently used routine. I also dislike the name of the routine, probably even more than you do. Sorry. jiri -----Original Message----- From: David Cuny <dcuny at LANSET.COM> To: EUPHORIA at LISTSERV.MUOHIO.EDU <EUPHORIA at LISTSERV.MUOHIO.EDU> Date: Sunday, November 15, 1998 7:06 AM Subject: using compare >[to anyone who has tried to send me any personal e-mail recently - my e-mail >got mangled, and kept looping on Jesse Kint's message... now I don't seem to >be able to get stuff from the Euphoria server, and so I have to check the >archives for posts. ] > >Jiri wondered: > >> I just want to know why you stubbornly and wastefully use >> the despised compare() function even when both arguments >> are integers? > >Ouch. > >You are certinly right about the "despised" portion - I hate doing work >that's easily done by the compiler. But I've gotten burned so often by >accidentally using '=' that I use 'compare' out of habit. > >But is 'compare' that inefficient? I would imagine that Robert could fairly >easily check the args and make it as efficient as '=' if he wanted to (is >this already being done?). That might be a nice feature for people like me >that are "wasteful" in not optimizing their code. > >Thanks. > >-- David Cuny >