proposal-block-params
proposal-block-params copied to clipboard
A syntactical simplification in JS to enable DSLs
I really like block params as it would generalize the syntax https://github.com/tc39/proposal-pattern-matching is trying to add. Which happens to what I incidentally did using with [patcom](https://github.com/concept-not-found/patcom#comparision-of-tc39-pattern-matching-proposal-on-left-to-patcom-on-right) [See example](https://github.com/samuelgoto/proposal-block-params/issues/45#issuecomment-1066171236) ~~We could...
How does this proposal relate to the [do block](https://github.com/tc39/proposal-do-expressions) and [explicit resource management](https://github.com/tc39/proposal-explicit-resource-management) proposals? I'm noticing that the basic functionality of both of these proposals can trivially be implemented with...
The whole `::` idea is intriguing, but in the end, it really doesn't provide much value to the language, nor is it an essential part of the core concept of...
The core of this proposal is awesome - allowing us to pass blocks into functions. Unfortunately, on top of this core seems to be this idea of trying to allow...
There seems to be two conflicting ideas in this proposal. 1. we want this to transpile down to simple functions. 2. we want to follow the Tennent's Corresponde Principle. The...
```js f(arg) { ... } ``` As current syntax of this proposal, such code will have different semantic in/not in the class body, which is very confusing, error-prone, and harm...
@dherman writes: ```javascript async function readstuff (cfg) { let fileA = null; unless (cfg.skipA) { fileA = await cfg.fileA; } // ... } ``` Are ```await``` allowed inside block params?...
This came up multiple times during the review, so kicking off a thread to allow commenting. The problem comes down to: If we bake this in, do we corner ourselves...
Could it make sense to make arguments syntax for-like? Instead of writing ```javascript // ... this is what you write ... a(1) do (foo) { // ... } // ......
I started to learn how to code with Ruby, which heavily uses this type of syntax, and I really didn't understand how blocks worked until I started passing functions as...