On 5 August 2015 at 23:40, Jonathan S. Shapiro <[email protected]> wrote:
> ... the kinds of resources we
> tend to be talking about are both precious (that is: in limited supply) and
> coarse (that is: there is a lot of incentive not to hold them longer than we
> need them). This how we get to patterns like the destroy/finalize pattern
> that exists in .NET and elsewhere.
>
> But it seems to me that this leaves us with the modularity problem unsolved.
> Improved, certainly, but unsolved.
>
> What's the sense of things on this? Is this viewed as a real issue in
> practice?

The last heated discussion we had on this subject on cap-talk I
outlined a solution that I wish was more popular: a fluid (thread
local variable, for you non-scheme types) that callees could attatch
resources to. Such fluids could be introduced by existing IDisposable
patterns or managed explicitly if you prefer.  Since it's a fluid it's
reasonable to provide a default one on thread creation.  There is some
work required for the programmer when you want a resource as the
return value, but it seems that it's a sensible default.

It was heated because a lot of people seem to feel that RAII is the
best way to handle resources, and Rob Meijer feels that
reference-counting semantics are so awesome that they should be part
of the language definition.

-- 
William Leslie

Notice:
Likely much of this email is, by the nature of copyright, covered
under copyright law.  You absolutely MAY reproduce any part of it in
accordance with the copyright law of the nation you are reading this
in.  Any attempt to DENY YOU THOSE RIGHTS would be illegal without
prior contractual agreement.
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to