FW: [Seaside] Ports of Seaside - are there useful modules

Avi Bryant avi@beta4.com
Wed, 1 May 2002 12:06:43 -0700 (PDT)

On Wed, 1 May 2002, Jeffrey Odell wrote:

> Still considering a port to Dolphin Smalltalk.  Given the answer below,
> does it make sense that, until we have continuations (which I think
> there is a reasonable chance of getting OA to do eventually), we can
> implement the callPage: concept by having each IAPage save it's state in
> an "page specific" manner, as well as it's place in the page call stack?
> In other words, isn't a continuation just a low level, admittedly very
> cool, way of:
> - saving the state of the component,
> - saving it's place in the call-return list of components?

Well, no, not really.  It's not just saving the current component, it's
saving the current spot in the current method of the current component.
There really aren't any good halfway solutions - either Dolphin has some
way to return twice from the same method call, or it doesn't.

There is what's called "continuation passing style", which involves
explicitly passing around blocks which represent the current continuation.
In that case, code like:

  |name address|
  "random silly example"
  name := self callPage: (IANamePage new).
  address := self callPage: (IAAddressPage new).
  ^ Array with: name with: address

would become

getNameAndAddressWithContinuation: returnBlock
  self callPage: (IANamePage new)
         [:name |
         self callPage: (IAAddressPage new)
                [:address |
                returnBlock value:
                 (Array with: name with: address)]]

As you can see, that becomes cumbersome very quickly.  However, it's a
good way to understand what's actually going on underneath.

Has ObjectArts said anything about the possibility of adding continuations
to the VM?