[Seaside-dev] thoughts on partial continuations

Paolo Bonzini bonzini at gnu.org
Thu Feb 5 07:26:37 UTC 2009


> 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.

I'm actually not sure which one is a lesser evil.

> 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?

Certainly so, at least IMO.  In fact it could be worthwhile to have
something like

   answer: aBlock ensure: ensureBlock
       self answer: (aBlock ensure: ensureBlock)

or

   answer: anObject ensure: ensureBlock
       ensureBlock value.
       self answer: anObject

which will (though surprisingly for the latter) do the right thing (in
case ensure: is being used just to return the value of the *first* block).

Paolo


More information about the seaside-dev mailing list