1. using compare
- Posted by David Cuny <dcuny at LANSET.COM> Nov 14, 1998
- 555 views
[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
2. 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 >
3. Re: using compare
- Posted by David Cuny <dcuny at LANSET.COM> Nov 14, 1998
- 546 views
- Last edited Nov 15, 1998
Jirir wrote: >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. No insult taken. You were right; I was on auto-pilot when I wrote the code. I saw and_bits() and replaced it with what I thought was an equivalent function. -- David Cuny