lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

I think approaches like this are fundamentally flawed: you're spending a lot of effort to shoe-horn an interaction into control structures that it takes a Ph.D. to understand and that are essentially black boxes.

Instead, just describe the interaction declaratively as a data structure (add some lambdas if you really need a little bit of computation somewhere) and then interpret that data structure.  Such a declarative approach is simpler, gives you much more flexibility in defining and changing control structures, can be implemented in any programming language, and people can build tools to manipulate the interaction itself.


On 8/22/07, David Given <> wrote:
Hash: SHA1

Roberto Ierusalimschy wrote:
>>      Web sites based on continuations are in use already, but mostly
>> not in Scheme. The Seaside[1] framework is written in Smalltalk and
>> uses them. The Common Lisp frameworks UnCommon Web[2] and Weblocks[3]
>> too.
> But do they benefit from multiple shots?

I know that Seaside does. It uses continuations to 'remember where it was'
when the user backs up through a series of forms. e.g., given code similar to

function doFormSeries()
        r1 = getResultFromUser()
        r2 = getResultFromUser()
        r3 = getResultFromUser()
        performTransaction(r1, r2, r3)

(which is all quite doable with Lua coroutines), it allows the user to proceed
up to form 3, then press back to go to form 2, fill in different data, and
continue from there --- and the programmer doesn't have to write any extra
code to make this happen. It's amazingly neat, but does require non-standard
Smalltalk features.

- --
┌── ─── ───────────────────

│ "There does not now, nor will there ever, exist a programming language in
│ which it is the least bit hard to write bad programs." --- Flon's Axiom
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla -