Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Continuations
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-08-25 (11:13)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] Continuations
On Wed, 2004-08-25 at 08:18, Nathaniel Gray wrote:
> On 24 Aug 2004 16:47:31 +1000, skaller <> wrote:
> > On Tue, 2004-08-24 at 08:32, Nathaniel Gray wrote:
> > 
> > > I wrote a "simple" tutorial on continuations that you might try
> > > reading.  You can find it here:
> > >
> > >
> > > Let me know if there is anything that you think could be improved in
> > > terms of clarity.
> > 
> > This is a nice article to read if you know Python.
> The intention was that that wouldn't matter.  :-) 

That's easy for a Python programmer to say. However I suggest
you pick some language you don't know and have someone
tell you how it works then look at some code... sure,
you can figure out what it does -- painfully -- but you
can't *see* what it does. Which you can for a language you're
familiar with. I think it's like driving a car. Knowing the 
theory is different to being able to do everything automatically.

> As you and several others have pointed out, I may have
> swept too much under the rug.

I wouldn't want to go thru the agony of CPS transforming
some code to avoid stacks -- only to find the result
just used a list instead :)

> I suppose you could put any non-recursive (or tail-recursive)
> sub-computation on the stack.  That would preclude the use of CPS to
> support microthreading, however. 

Ah no, but it doesn't!  Felix has an explicit yield
operator 'read event', it can only be used in procedures, 
not in  functions.  So functions are stackable, whilst 
procedures are not -- context switching isn't
supported in functional code, only in procedural code.

Perhaps that seems like an onerous restriction,
but it in theory it isn't -- functions aren't
allowed to have side effects.. and reading data
has a definite side effect.

John Skaller,
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: