-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
lazy coalesce syntax proposal #26303
Comments
+1, but I think there are two secondary questions to address:
While we're at it, I'll mention that some languages like Kotlin use |
We could potentially make prefix |
Isn't there a typo in the OP with |
Yes, I got the order wrong in the ternary. |
I have just found this issue. My opinion is that if we implement |
is there any library with a lazy "something" macro? |
I'm pretty sure Base has |
Yes, it's even exported thanks! |
I propose the following syntaxes:
val ?? default
forval === nothing ? val : default
val ?= default
forval === nothing ? val : (val = default)
d[key] ?? default
forget(()->default, d, key)
d[key] ?= default
forget!(()->default, d, key)
The text was updated successfully, but these errors were encountered: