DEV Community

Cover image for Scheme: eqv? vs equal?
Odai Athamneh
Odai Athamneh

Posted on • Updated on

Scheme: eqv? vs equal?

Photo by Piret Ilver on Unsplash


You can read a few lengthy explanations on Stack Overflow, but in a nutshell:

  • equal? returns true if its arguments have the same structure. This is comparable to == in most languages.
  • eqv? is a pointer comparison. It looks at memory addresses.
    • The exception is numbers.
    • Unlike eq?, it will compare numeric data instead of addresses.
    • However, it won't convert between int and float data.

Further Reading

Top comments (0)