Hacker GitHub

← All repos

tc39/proposal-do-expressions

View on GitHub ↗ ★ 1,194 HTML

Proposal for `do` expressions

23 mentions on Hacker News by 21 people: 2 stories, 21 comments · first 2017-10-24 · latest 2025-12-20

Mentions per year 23 mentions · busiest year 2023 (5)
20082026
  1. https://github.com/tc39/proposal-do-expressions (Not to be confused with do notation)
    comment by pwdisswordfishy · 2025-12-20 · in Rust's Block Pattern
  2. For “everything is an expression” https://github.com/tc39/proposal-do-expressions may be of interest, though discussion seems to have paused.
    comment by btown · 2024-10-22 · in Civet: A Superset of TypeScript
  3. …not pretty though, and I think the do expressions proposal would rid my codebases of this pattern: https://github.com/tc39/proposal-do-expressions
  4. …pattern matching/switch expressions They're still waiting on the do expression proposal for that ( https://github.com/tc39/proposal-do-expressions ), which has been in the bikeshedding stage for the past five years.
    comment by crooked-v · 2023-08-18 · in TypeScript is surprisingly ok for compilers
  5. …proposal[1] is pretty much this (but it’s only stage 1 so who knows when/if it’ll land). 1: https://github.com/tc39/proposal-do-expressions
    comment by eyelidlessness · 2023-02-27 · in CoffeeScript for TypeScript
  6. There's a dormant proposal about this: https://github.com/tc39/proposal-do-expressions
  7. …there is a proposal ("do expressions") to allow this: const a = do { if (b) { 5 } else { 10 } }; https://github.com/tc39/proposal-do-expressions
  8. …the last statement. There's a proposal for precisely that. Unfortunately, only Stage 1 though. https://github.com/tc39/proposal-do-expressions
    comment by TheAngush · 2023-01-20 · in Pipe Operator (|>) For JavaScript
  9. For reference. Pattern matching: https://github.com/tc39/proposal-pattern-matching Do expression: https://github.com/tc39/proposal-do-expressions Pipe operator: https://github.com/tc39/proposal-pipeline-operator
    comment by gherkinnn · 2022-10-04 · in The TC39 Process
  10. …to it: More hands-on/direct: https://github.com/tc39/proposal-pattern-matching More indirect: https://github.com/tc39/proposal-do-expressions > list comprehensions There are several libraries with strong Iterator support today that while…
  11. …years, which addresses this (though it is more verbose). I hope it will be accepted some day. [0] https://github.com/tc39/proposal-do-expressions
    comment by molf · 2022-03-09 · in Advice on JSX Conditionals
  12. https://github.com/tc39/proposal-do-expressions Allows you to contain temporary variables to where they are needed, rather than having them remain active through the remainder of the current scope. You could do that with immediately…
    comment by mschuetz · 2021-12-13 · in Deno Joins TC39
  13. …proposal is a good example of that. Edit: forgot to link to the issue tracker I referenced above https://github.com/tc39/proposal-do-expressions/issues
    comment by spmurrayzzz · 2021-12-13 · in Deno Joins TC39
  14. …to operate on JSX. There's the do-expression proposal to achieve what you want in a sane way: https://github.com/tc39/proposal-do-expressions
  15. …that (because it's not as easy as just making `const x = for(let i of foo) { yield i; };` parse.) https://github.com/tc39/proposal-do-expressions https://babeljs.io/docs/en/babel-plugin-proposal-do-expressi...
    comment by svieira · 2020-12-17 · in A case study on strict null checks
  16. That may be a nice addition to the "do expression" proposal for javascript: https://github.com/tc39/proposal-do-expressions let x = do { let tmp = f(); tmp * tmp + 1 }; Unfortunately it seems like the proposal doesn't get much attention.
  17. …function expressions. A compact syntax for achieving this is the "do expression": https://github.com/tc39/proposal-do-expressions
  18. maybe do-expression proposal could help https://github.com/tc39/proposal-do-expressions
  19. ▲ 2
    ECMAScript proposal for expression-oriented style
    story by Avi-D-coder · 2019-06-16 · 0 comments
  20. Your wish can come true. Take a look at this stage 1 of the TC39 proposal. https://github.com/tc39/proposal-do-expressions
  21. "do" expressions have been proposed as well: https://github.com/tc39/proposal-do-expressions Babel supports it if you want to live on the bleeding edge: https://babeljs.io/docs/plugins/transform-do-expressions/ It would be kind of neat if…
    comment by tlrobinson · 2018-04-25 · in JavaScript Pattern Matching Proposal
  22. >do-expressions already have a proposal For those who are curious, it's this one: https://github.com/tc39/proposal-do-expressions .
    comment by networked · 2018-02-24 · in Escaping Hell with Monads (2017)
  23. ▲ 1
    ECMAScript proposal: do expressions
    story by adrianbordinc · 2017-10-24 · 0 comments