[plt-scheme] String equality and other questions

From: Deep (deepankar.sharma at gmail.com)
Date: Wed Sep 24 00:25:26 EDT 2008

While writing a game in scheme I recently ran into an issue where
using equal? to compare strings would wait on the equality test and
hog the cpu 60-70% of the time.  Oddly enough it worked sometimes. I
looked through my code suspecting a recursive call gone amuck but
eventually narrowed the issue down to this call.  I had unfortunately
run into http://www.federated.com/~jim/schintro-v14/schintro_102.html
when searching for "scheme string equality" and used equal?.

Once I looked again and changed the code to use string=? things work
just fine. I wanted to know what does equal? do when used against
strings. Why does it work sometimes and why does it just hang on other
occasions?

Btw this is on Max OSX using the latest version of DrScheme.


Posted on the users mailing list.