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] queasiness about Exit
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-11-18 (00:01)
From: Daniel de Rauglaudre <daniel.de_rauglaudre@i...>
Subject: Re: [Caml-list] queasiness about Exit

On Fri, Nov 16, 2001 at 02:05:15PM +0200, Lauri Alanko wrote:

> This seems like something where first-class continuations would be
> useful. Are there any plans on adding them to O'Caml? SML/NJ at least
> seems to have them.

This is feasible, I implemented them in Caml Light some years ago. But
in the implementaion of SML/NJ, continuations are "light" and natural
because their execution "stack" is implemented not by a stack but by a
list. To get the continuation, you has just to get the "stack pointer".
In OCaml, you should make a copy of the execution stack.

> If full continuations are too expensive, even upwards-only continuations
> would be a handy alternative to exceptions.

Why not using exceptions, then? Do you mean that you want to be able to
restart the same continuation several times?

Bug reports:  FAQ:
To unsubscribe, mail  Archives: