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.

Cheers,
Thomas.

On 8/22/07, David Given <dg@cowlark.com> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
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
this:

function doFormSeries()
        drawForm1()
        r1 = getResultFromUser()
        drawForm2()
        r2 = getResultFromUser()
        drawForm3()
        r3 = getResultFromUser()
        performTransaction(r1, r2, r3)
end

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

- --
┌── dg@cowlark.com ─── http://www.cowlark.com ───────────────────

│ "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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGzFQJf9E0noFvlzgRAgYhAJ9RHU+kdbY73bnymyRy8AoesF/X0wCeI/D4
bC2pUvYFaZr0Q+9ZzVJEtFM=
=wZMr
-----END PGP SIGNATURE-----