[Seaside-dev] thoughts on partial continuations

Julian Fitzell jfitzell at gmail.com
Wed Feb 4 21:27:55 UTC 2009


On Wed, Feb 4, 2009 at 9:40 PM, Paolo Bonzini <bonzini at gnu.org> wrote:

>
> >     Neither do I.  Mixing #ensure: and continuations is a sure way to get
> >     either leaks or doubly released objects (which means either
> exceptions,
> >     or bugs too-much-reminding-of-C).
> >
> > That seems like "conventional wisdom" to me again. Obviously you can run
> > into problems depending on what you put in your ensure block. But I
> > don't yet see that:
> >
> > self inform: 'foo'.
> > self releaseAnObject
> >
> > is any less likely to cause doubly released objects than
> >
> > [self inform: 'foo'] ensure: [self releaseAnObject]
>
> Of course, but then the ensured block (the argument) is *not* ensured in
> practice (just invoked after the #inform: answers), which makes the
> latter form actually confusing.
>

Yes, you're right. Avi pointed this out to me on IM as well and this was the
piece I hadn't considered. I wasn't thinking about the case where the web
app user never finishes executing of the block of code. I now get that your
argument is that calling ensure blocks on every request is a lesser evil
than possibly never calling them, which is certainly a reasonable position
to take.

Is it a problem then that currently

[ self call: a ] ensure: [ self foo ]

results in the ensure block being run on call but with

[ self answer: b ] ensure: [ self foo ]

the ensure block will not be run?


Julian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside-dev/attachments/20090204/2b801b28/attachment.htm


More information about the seaside-dev mailing list