chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] gui api design -- some thought -- long mail


From: Alex Shinn
Subject: Re: [Chicken-users] gui api design -- some thought -- long mail
Date: Sat, 10 Feb 2007 00:35:31 +0900

Hi,

On 2/7/07, minh thu <address@hidden> wrote:

What I Don't Like About Callbacks.

a) Putted simply, you can't mix gui events with
application specific events.
b) (which is related) Since a function call results
from an event, you can't generate an event whose
callback needs the end of
the event-generating-computation (i.e. it's not
asynchronous).

Luckily, Scheme has first class continuations which overcome all
such obstacles! :)

Mixing interaction and computation is a common problem, which
different apps handle in different ways.  This is the cause of
one of the great user banes, the modal window.  Because typically
the programmer can only process through one computation stack at
a time, she often resorts to forcing the user through a strict
GUI sequence with such windows.

Somewhat more flexibly, Emacs, when accepting input for an
extended command, manually keeps track of the command being
called and the inputs received so far, and lets you suspend this
and switch to a different task with something called a
"recursive edit."  It has various limitations and is only
available for registered commands, not arbitrary functions.

However, edwin, the MIT Scheme editor (and other Scheme based
Emacs clones), allows you to suspend any computation at all with
call/cc.  Thus you can have a natural flow with the user jumping
back and forth between arbitrary user interactions and
computations.  The same could apply for any arbitrarily complex
graphical app, or even over a client server split, as has
recently been the rage with continuation based web servers.

--
Alex




reply via email to

[Prev in Thread] Current Thread [Next in Thread]