domenic / proposal-blocks

Former home of a proposal for a new syntactic construct for serializable blocks of JavaScript code
215 stars 5 forks source link

Relation with `do` expressions #4

Closed caub closed 6 years ago

caub commented 6 years ago

This proposal looks more powerful than do expressions, would it be worth having those 2 proposals together?

domenic commented 6 years ago

They seem unrelated to me. I'll close but feel free to ask for clarification in the closed thread.

caub commented 6 years ago

Right, blocks are always async, do-expressions can be sync

ljharb commented 6 years ago

do expressions also can use bindings without explicitly capturing them, and aren’t first-class repeatable code.

domenic commented 6 years ago

I mean, they're just different features. The only commonality is that they allow code between some sort of braces. But that's like saying that do expressions are the same as if statements or for loops.