[cap-talk] Composability and RAII
capibara at xs4all.nl
Sun Mar 6 23:28:53 PST 2011
On Mon, March 7, 2011 07:03, Rob Meijer wrote:
>> This discussion started out on the assumption that some resource
>> lifetimes *cannot* be represented as a variable with a particular
>> scope. In the cases it can, a with statement is sufficient and
> The problem with finaly/with in these cases comes with the fact that for
> the finaly/with solution being a resource that requires this solution to
> be used is transitive to composition.
I just noticed, re-reading my own sentence, I had trouble parsing it
myself. So for clarity reasons let me rephrase it:
The problem with finaly/with in these cases comes from the fact that:
Being 'a resource that requires finaly/with to be used' is transitive to
> David-Sarah argues that this
> transitive property is correct, I argue that it brakes encapsulation.
> For these cases C++ stile RAII allows for full encapsulation of the
> knowledge of the presence of deep resources.
>> It is the other cases that are interesting.
> The other cases are where C++ RAII also breaks down. I tried to argue that
> cPython (reference counted GC) shows that a combination of reference
> counted GC with RAII can be a good solution there.
> cap-talk mailing list
> cap-talk at mail.eros-os.org
More information about the cap-talk