-
Notifications
You must be signed in to change notification settings - Fork 371
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
unquote-splice
interacts with HySymbol weirdly
#1509
Comments
Why not? That seems like a fine behavior to me. |
Because its an implicit type coercion that makes no sense imho:
A symbol was turned into a string that was iterated on. I mean, if this behaviour showed up, how much more likely is to have been a bug than the intended behaviour? But imho I'm really not a fan of treating symbols as strings. |
They seem very string-like to me, is all I can say, I guess. Certainly I wouldn't have expected |
unquote-slice
interacts with HySymbol weirdlyunquote-splice
interacts with HySymbol weirdly
Honestly, I would have expected a TypeError or ValueError. I think its more the type cohesion to string that's happening is what's bothering me (e.g. I think I can understand why it was done intentionally, when getattr and co take strings, and python objects are really just tables, but they're not really the same thing. Attributes are a subset of valid keys. so I have no expectation for them to be interchangeable. I guess Hy is also not limited to Python's rules for identifiers. I mean, I can live with it. |
Things have changed since this issue such that |
I think this can be addressed in #1504, if I also break
HySymbol
so it doesn't inherit fromstr
, like I did withHyKeyword
, because otherwise this happens:HySymbol
shouldn't be iterable.The text was updated successfully, but these errors were encountered: