Add one-line using without variable #7882
Replies: 3 comments 4 replies
-
The challenge here is that is |
Beta Was this translation helpful? Give feedback.
-
I think he best syntax for this would be using _ = GIL.Acquire(); No conflicts with existing syntax (this doesn’t compile today including on top-level statements), and I think a discard is a very good indicator to the reader that a value is generated, and ignored. |
Beta Was this translation helpful? Give feedback.
-
See existing discussions on this:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What I mean is instead of doing
using var _ = GIL.Acquire();
it would make sense to enableusing GIL.Acquire();
. This same feature is already enabled in block using:Akin to
defer
in Golang and others, but this one will support onlyIDisposable
and not just any statement.I think this will make the code simpler.
Beta Was this translation helpful? Give feedback.
All reactions