From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 2C2D0BC32 for ; Wed, 16 Mar 2005 17:06:09 +0100 (CET) Received: from chico.mail.uwo.ca (chico.mail.uwo.ca [129.100.253.72]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j2GG68dN005956 for ; Wed, 16 Mar 2005 17:06:08 +0100 Received: from spork.its.uwo.ca ([129.100.254.76]) by chico.mail.uwo.ca (Sun Java System Messaging Server 6.1 (built Apr 28 2004)) with ESMTP id <0IDG00HVVCQ6V681@chico.mail.uwo.ca> for caml-list@yquem.inria.fr; Wed, 16 Mar 2005 11:06:08 -0500 (EST) Received: from whitehead.apmaths.uwo.ca (whitehead.apmaths.uwo.ca [129.100.144.166]) by spork.its.uwo.ca (8.12.10/8.12.10) with ESMTP id j2GG5qU7014514 for ; Wed, 16 Mar 2005 11:05:52 -0500 Received: from ip6-localhost ([::1]) by whitehead.apmaths.uwo.ca with esmtp (Exim 3.36 #1 (Debian)) id 1DBb1r-0007nk-00 for ; Wed, 16 Mar 2005 11:05:51 -0500 Date: Wed, 16 Mar 2005 11:05:45 -0500 From: Tyson Whitehead Subject: Tail Recursion on Map, Append, etc. To: caml-list@yquem.inria.fr Message-id: <200503161105.49726.twhitehe@uwo.ca> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT Content-disposition: inline X-Scanned-By: MIMEDefang 2.39 User-Agent: KMail/1.7.2 X-Miltered: at concorde with ID 42385970.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; recursion:01 hash:01 recursion:01 compiler:01 caml-list:01 caf:01 recursive:01 compiler:01 ocaml:01 discusion:98 tail:01 tail:01 functions:01 functions:01 passing:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I was wondering about the status of map and friends with regard to tail recursion. There was a big discussion back in 2003 about specific solutions (implementation of the those functions using Obj) and more general compiler support for holes/destination passing. It started with the following message: http://caml.inria.fr/pub/ml-archives/caml-list/2003/01/4a9754e53ff07723caf21b4496d1d267.en.html It sounded to me like the general consensus was to immediately implement the specific tail recursive versions of these functions for List and friends (which were provided in the discusion), and then improve the compiler by adding support for advanced hole/destination passing solutions. Looking at the list implementation in the OCaml Debian unstable source, it doesn't look like the more efficient version has been implemented. Further, looking at the assembler emitted for the code it doesn't look like the compiler supports holes/destination passing either. January 2003 was quite a while ago, anybody know what's up here? Thanks! -T - -- Tyson Whitehead (-twhitehe at uwo.ca -- WSC-) Computer Engineer Dept. of Applied Mathematics, Graduate Student- Applied Mathematics University of Western Ontario, GnuPG Key ID# 0x8A2AB5D8 London, Ontario, Canada -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCOFldRXbLmIoqtdgRArjXAKDX1ntabSketcJX37uy/GnjMBXclACgnl7i D2JY8tHbtwrY6/HtErXpy5c= =X6rG -----END PGP SIGNATURE-----