[plt-scheme] String equality and other questions

From: Eli Barzilay (eli at barzilay.org)
Date: Wed Sep 24 00:43:48 EDT 2008

On Sep 23, Deep wrote:
> 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.

They should have roughly the same runtime, maybe you're running into a
bug?

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!


Posted on the users mailing list.