From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA09187; Thu, 14 Oct 2004 11:52:10 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA09442 for ; Thu, 14 Oct 2004 11:52:09 +0200 (MET DST) Received: from eris.rz.uni-saarland.de (eris.rz.uni-saarland.de [134.96.7.8]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id i9E9q9EY025872 for ; Thu, 14 Oct 2004 11:52:09 +0200 Received: from cs.uni-sb.de (cs.uni-sb.de [134.96.254.254]) by eris.rz.uni-saarland.de (8.12.10/8.12.10) with ESMTP id i9E9q8UZ10414527 for ; Thu, 14 Oct 2004 11:52:08 +0200 (CST) Received: from mail.cs.uni-sb.de (mail.cs.uni-sb.de [134.96.254.200]) by cs.uni-sb.de (8.13.1/2004080400) with ESMTP id i9E9q7Yn018528 for ; Thu, 14 Oct 2004 11:52:07 +0200 (CEST) Received: from ps.uni-sb.de (grizzly.ps.uni-sb.de [134.96.186.68]) by mail.cs.uni-sb.de (8.13.1/2004093000) with ESMTP id i9E9q6hn014146 for ; Thu, 14 Oct 2004 11:52:06 +0200 (CEST) X-Authentication-Warning: mail.cs.uni-sb.de: Host grizzly.ps.uni-sb.de [134.96.186.68] claimed to be ps.uni-sb.de Received: from ps.uni-sb.de (groove.ps.uni-sb.de [134.96.186.172]) by ps.uni-sb.de (8.12.10/8.12.10) with ESMTP id i9E9q5h3000627; Thu, 14 Oct 2004 11:52:05 +0200 Message-ID: <416E4C45.1090804@ps.uni-sb.de> Date: Thu, 14 Oct 2004 11:52:05 +0200 From: Andreas Rossberg User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1) Gecko/20031114 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Caml List Subject: Re: [Caml-list] About Obj (was Recursive lists) References: <41669437.3010201@yahoo.it> <4166A395.70301@yahoo.fr> <4166DC42.3090602@baretta.com> <16746.15832.409677.764564@gargle.gargle.HOWL> <416A8CDA.7060407@univ-savoie.fr> <00F89380-1BA2-11D9-B4CE-000A958FF2FE@wetware.com> <416D14C3.4030902@baretta.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.5.1 (eris.rz.uni-saarland.de [134.96.7.8]); Thu, 14 Oct 2004 11:52:08 +0200 (CEST) X-AntiVirus: checked by AntiVir Milter 1.0.6; AVE 6.28.0.7; VDF 6.28.0.16 X-Miltered: at nez-perce with ID 416E4C49.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; rossberg:01 rossberg:01 uni-sb:01 caml-list:01 brogoff:01 dialect:01 overkill:01 recursion:01 light-weight:01 abstractions:01 uni-sb:01 logical:02 laziness:02 implicit:02 modulo:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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 List.map 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, rossberg@ps.uni-sb.de Let's get rid of those possible thingies! -- TB ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners