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] Recursive lists
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-10-14 (09:52)
From: Andreas Rossberg <rossberg@p...>
Subject: Re: [Caml-list] About Obj (was Recursive lists)
brogoff wrote:
> I remembered shortly after I asked that Alice ML also provides a way to handle
> these tail recursive (modulo cons) functions by providing a library for
> Prologish logical variables called "promises" in that dialect. Neat idea, and
> useful for more than tail recursive lists, but I wonder how efficient the
> implementations are.

Promises surely would be overkill for just tail recursion. And I'm 
afraid that the general overhead their presence introduces may well be 
larger than the bit of efficiency you can squeeze out by making 
tail recursive. (It is similar to laziness, and Alice uses reflective 
just-in-time compilation to avoid redundant tests for promised values.)

Promises, and more generally futures, have been introduced for 
light-weight concurrent programming with implicit dataflow 
synchronisation. They enable coding all kinds of concurrency 
abstractions. You can also use promises to e.g. construct data 
structures top-down (of which tail recursive map or append functions are 
simple instances), but that rather is a neat side effect and not their 
primary motivation.

	- Andreas

Andreas Rossberg,

Let's get rid of those possible thingies!  -- TB

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