Adding Go's defer to the TypeScript Compiler

3 points by nemin


frontsideair

If I'm not missing anything, we already have the using statement that does the same job.

quad

We don't just have using, we have DisposableStack:

using stack = new DisposableStack();
await sema.acquire();
stack.defer(() => sema.release());

Or more tightly:

stack.adopt(await sema.acquire(), () => sema.release());
peter-leonov

Real nice language experiment. Love these!

Are you hacking the old TS based compiler or the new Go one?