rokucommunity / rokucommunity/brighterscript
Simplified syntax for null-coalescing operator
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 208
- Forks
- 68
- Avg merge
- 8h 39m
- Merged PRs (30d)
- 39
Description
I was showcasing ternary and null-coalescing operators in a workshop today, and this question came up: "why is ternary turning simple expressions into if/else statements, but null-coalescing doesn't?"
So we could take #1341 and extend it to null-coalescing expressions.
chosenUser = user ?? {}
' transpiles to...
chosenUser = bslib_coalesce(user, {})
' but it could transpile to...
chosenUser = user
if chosenUser = invalid
chosenUser = {}
end if
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.