Skip to content

Commit

Permalink
Fix using/await using typo in april-10.md (#328)
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung authored Jun 6, 2024
1 parent fdc76c9 commit ee2ea8a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions meetings/2024-04/april-10.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ Presenter: Ron Buckton (RBN)
- [proposal](https://github.com/tc39/proposal-discard-binding)
- [slides](https://1drv.ms/p/s!AjgWTO11Fk-TkqpoWw0poDW3dawBQg?e=O3UP1c)

RBN: So good morning. For the next few minutes, I’ll be talking about discard bindings proposal based on where we stand with the proposal right now and the potential for where this is going to go in the future. So to start, just a brief overview. The concept of a “discard”: it’s a “non-named placeholder for a variable binding”. It allows you to align unnecessary variable names in various contexts such as using and wait using declarations, function/method parameters, array structure patterns, extractor patterns and pattern matching. We currently are proposing the use of the void keyword in place of a binding identifier, and the idea of discards in general has prior art across numerous languages, C C++, C#, Python, rust, and Go, C and C++ allow you to align parameter names, for example, C#, Python, rust and go all use the underscore and now added to that list is java is adopting underscore with the mechanism which it uses for establishing discards.
RBN: So good morning. For the next few minutes, I’ll be talking about discard bindings proposal based on where we stand with the proposal right now and the potential for where this is going to go in the future. So to start, just a brief overview. The concept of a “discard”: it’s a “non-named placeholder for a variable binding”. It allows you to align unnecessary variable names in various contexts such as `using` and `await using` declarations, function/method parameters, array structure patterns, extractor patterns and pattern matching. We currently are proposing the use of the void keyword in place of a binding identifier, and the idea of discards in general has prior art across numerous languages, C C++, C#, Python, rust, and Go, C and C++ allow you to align parameter names, for example, C#, Python, rust and go all use the underscore and now added to that list is java is adopting underscore with the mechanism which it uses for establishing discards.

RBN: So, the motivations of the proposal where things stand, one of the reasons we want to have discards is that there are often a need for side effects from declarations without the actual variable binding. So, again, parameters that you might not want to necessarily name, that you’re not going to use when you’re overloading a method or sort of overriding a method or passing a function as callback. Variable bindings that you need for their effect, reading a property or skipping a value in an array structuring or in the case of using declarations, a binding that establishes a resource that exists within this lifetime a bound to a block scope, but you don’t intend to use the resource value after the fact. This is the case for things like locks in a shared memory environment. But also could be used for things like log and tracing patterns in a function, et cetera.

Expand All @@ -199,7 +199,7 @@ RBN: So this is why we’re look for something that’s an explicit syntax to in

RBN: We’ve also discarded other less-motivated locations for discard such as catch bindings, we already have bindingless catch. Import and export, because you can just ally those imports and exports. There’s generally no semantic meaning behavior behind not using the imports if you’re not referencing them. There’s no getters that trigger, no side effects you need to care about there. Class and function names aren’t necessary because you can align those names with their expressions or default exports. There’s no real need to insert anything there, and field names don’t make sense because you have constructors and static blocks, so you have places to evaluate things that do not need a binding in those cases.

RBN: So brief summary of the current state. For use and await using, we want to be able to say using void equals or await using void equals as a way to register the resource that is being initialized without actually introducing a binding. This was a capability that was introduced and was part of the proposal in various forms since its inception and was removed to reach more of an MVP version of the proposal and always been considered a high priority capability to add back in. We postpone that buzz we want to look at the broader capability of discards across the Lang. In addition to that, we talked about binding patterns, being able to exclude properties you don’t want in a spread or rest assignment to another object as a use case.
RBN: So brief summary of the current state. For `using` and `await using`, we want to be able to say using void equals or await using void equals as a way to register the resource that is being initialized without actually introducing a binding. This was a capability that was introduced and was part of the proposal in various forms since its inception and was removed to reach more of an MVP version of the proposal and always been considered a high priority capability to add back in. We postpone that buzz we want to look at the broader capability of discards across the Lang. In addition to that, we talked about binding patterns, being able to exclude properties you don’t want in a spread or rest assignment to another object as a use case.

Another use case is explicitly labelling things that illusions as trailing illusions especially you have the issue where you could be possibly confusing the number of commas you might see, just also currently supports them as well many assignment patterns. Parameters, so void, A to ignore a parameter in the leading parameters in a callback, in extractors to be able to skip over leading destructuring elements in the pattern, and in general, pattern matching also needs a mechanism to have an irrefutable discard, so you can say things like “X must exist, but I don’t care about its value”. And, again, in pattern matching, most languages that have pattern matching have some mechanism of discards that does this as well.

Expand Down

0 comments on commit ee2ea8a

Please sign in to comment.