News for hackers. Stuff that matters.
Re:TypeScript 5.2's New Keyword: 'using' by masklinn on Monday June 19, 2023 @11:38AM (#36392334)
It's ambiguous. Are you disposing of the object being destructured or the destructuring results? How do you make the distinction?

Much easier to not do it.

Re:TypeScript 5.2's New Keyword: 'using' by wruza on Monday June 19, 2023 @09:52PM (#36398776)
Not sure if this would produce more issues, but they could ignore c# and use something like:

  const using x = getX()
  const {using prop1, prop2} = using getX()
  void using getX()
  // x, prop1 and 2 anonymous Xs to dispose
Instead of giving `using` the power / the burden of variable creation. This also solves `using mutex.lock()` mentioned elsewhere itt.
Re:TypeScript 5.2's New Keyword: 'using' by saiojd on Monday June 19, 2023 @11:54PM (#36399510)
To me it seems like disposing of the object being destructured is the natural solution. But I can see where others will disagree.