Skip to content

default null syntax #1233

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

Open
He-Pin opened this issue Apr 27, 2025 · 0 comments
Open

default null syntax #1233

He-Pin opened this issue Apr 27, 2025 · 0 comments

Comments

@He-Pin
Copy link

He-Pin commented Apr 27, 2025

Motivation: when ?. is means we can call select on a nullable value, but it still throws Field does not exists exception.

What about using a obj.b? or obj['b'?] syntax to express: if bdoes not exists inobj, then returnnull` instead of an error.

  • obj.b?
  • obj["b"?]

or, we can just use std.get method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant