Function level try recourse directives.
Red IO
redio.development at gmail.com
Tue Dec 27 14:16:47 UTC 2022
This is a nice workaround but allocates additional resources and adds
clutter in form of (still) a level of nesting and an unnecessary
collection. Considering that try resource is only a syntactic sugar. It
shouldn't be difficult to add this simple addition of syntax to provide
this enormous ergonomic advantage. Also I think it's unlikely that try (...
); would find another useful use.
On Tue, Dec 27, 2022, 15:07 Mark Raynsford <org.openjdk at io7m.com> wrote:
> On 2022-12-27T14:49:13 +0100
> Red IO <redio.development at gmail.com> wrote:
> >
> > Sometimes we need to initialize something between the resources and we
> get
> > multiple levels of nesting.
> > And I was wondering if we could not just lose the block and auto close at
> > the end of a method like this :
>
> I work with Vulkan a lot, and that involves a metric ton of closeable
> resources that also have to be closed in stack order. I have a
> library-level solution for this:
>
> https://www.io7m.com/software/jmulticlose/
>
> --
> Mark Raynsford | https://www.io7m.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20221227/f8b66cb7/attachment.htm>
More information about the amber-dev
mailing list