-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eqv?: incorrect behavior with uninterned symbols #709
Comments
jpellegrini
added a commit
to jpellegrini/STklos
that referenced
this issue
Jan 29, 2025
uninterned, `eqv?` may consider both to be the same. With this patch, `eqv?` won't deal with uninterned symbols, rteating them always as "different from whatever else". This is the same behavior as Chez, Chicken, Gambit, Gauche, MIT. (Bigloo, Kawa, Chibi do not have string->uninterned-symbol). The change is: 1. In `eqv?`, check for hard equality (with `==`) so if one of the symbols is uninterned, the result is `#f` 2. Since we're at it, rewrite `symbol=?` so it will not accept non-symbol arguments (so its behavior will be the same as `string=?` So now: (eqv? (string->uninterned-symbol "x") (string->uninterned-symbol "x")) => #f This should fix egallesio#709
jpellegrini
added a commit
to jpellegrini/STklos
that referenced
this issue
Jan 29, 2025
Currently, if one of the symbols is uninterned, `eqv?` may consider both to be the same. With this patch, `eqv?` won't deal with uninterned symbols, rteating them always as "different from whatever else". This is the same behavior as Chez, Chicken, Gambit, Gauche, MIT. (Bigloo, Kawa, Chibi do not have string->uninterned-symbol). The change is: 1. In `eqv?`, check for hard equality (with `==`) so if one of the symbols is uninterned, the result is `#f` 2. Since we're at it, rewrite `symbol=?` so it will not accept non-symbol arguments (so its behavior will be the same as `string=?` So now: (eqv? (string->uninterned-symbol "x") (string->uninterned-symbol "x")) => #f This should fix egallesio#709
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When invoked on one or more uninterned symbols,
eqv?
gives a different answer fromsymbol=?
:In general,
eqv?
returns#t
for uninterned symbols with the same name:The text was updated successfully, but these errors were encountered: