IIFE Statements & Expressions

I saw your alternative to the do-expression proposal (after starting this discussion). It's nice. It makes a lot of sense. This suggestion is effectively just an extension to what you suggested.

Syntactically, we'd be consistently using do <keyword> ... to create a bunch of new expression types that are each directly derived semantically from the statement that corresponds to whichever keyword is used (with specific do-keyword combinations to avoid generalization).

Generalization not only permits all sorts of wacky, valid code, but (as you mentioned in your proposal) it also implies wacky language features that require a list of awkward restrictions to eliminate.

I think you're on to something, whether or not support for do-function gets included.

I personally like the idea of loops evaluating to an array of each iteration's value, but JavaScript already dropped array comprehensions (after FireFox implemented them), and the same arguments will presumably apply to loop-expressions. I don't actually know what the arguments were.

The do-const thing is a bit flakey, but being able to use a block of code in an expression is really useful.

CoffeeScript had a lot of good ideas. Fun times.