[Seaside-dev] thoughts on partial continuations

Julian Fitzell jfitzell at gmail.com
Wed Feb 4 17:48:36 UTC 2009


On Wed, Feb 4, 2009 at 5:47 PM, Randal L. Schwartz <merlyn at stonehenge.com>wrote:

> >>>>> "Julian" == Julian Fitzell <jfitzell at gmail.com> writes:
>
> Julian> You've thrown some new terminology in there and I can't quite work
> out
> Julian> what you're saying... can you give an example that shows what you
> mean
> Julian> in each case?
>
> internal = reset an instance var of self
> external = remove files from a scratch directory
>

But what do you mean by "objects that have been suspended"? Contexts? Or are
you talking about back-tracked state?

I mean, take the example of removing a file from a scratch directory. If you
wrote a callback like this:

doSomething
    file := self createScratchFile.
    [ self doSomethingWithTheFile.
    answer := self inform: 'The first thing is done'.
    self doMoreWithTheFile ]
        ensure: [ self removeScratchFile ]

You don't want the ensure block run when you hit the #inform: do you?

Obviously you need to be careful how you implement your #removeScratchFile
method because it could be evaluated more than once that is exactly the same
of an implementation without using ensure:

doSomething
    file := self createScratchFile.
    self doSomethingWithTheFile.
    answer := self inform: 'The first thing is done'.
    self doMoreWithTheFile.
    self removeScratchFile

This just seems like the normal problems associated with mixing the
back-button with a combination of backtracked and non-backtracked state.
#ensure: doesn't make it any worse.

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


More information about the seaside-dev mailing list