rokucommunity / rokucommunity/brighterscript

Simplified syntax for null-coalescing operator

Open
#1,406 3 comments 1 reaction 1 assignee View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.