-
Notifications
You must be signed in to change notification settings - Fork 227
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
if-let behavior appears different in #1188 #1189
Comments
Note that
For comparison its older behavior was: $ ./build/janet
Janet 1.28.0-dev-94722e56 linux/x64/gcc - '(doc)' for help
repl:1:> (when-let [[a b] nil] :a)
nil |
I'm pretty sure I came to rely on the not-erroring behavior because it seemed more convenient. I didn't look into why it was working and I didn't check that this wasn't intended (at least I didn't look closely at various docstrings nor did I ask around). I suppose if I'm alone in having gone this path then the good news is that there's only one person who needs to rewrite code :) |
(if-let [[a b] (possibly-nil-or-tuple)] ...) Seems like a perfectly valid use case, at least to me. I'll make an amendment. |
But this will mean the rules for not being to able to deconstruct a (if-let [a b] (something-that-can-not-be-deconstructed-into-a-b-tuple) ...) |
Yes, by definition really. if-let |
The following code used to not error for me:
With 2c3ca29 I get:
With 94722e5 I get:
The text was updated successfully, but these errors were encountered: