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: -- (:)
From: brogoff <brogoff@s...>
Subject: Re: [Caml-list] About Obj (was Recursive lists)
On Mon, 11 Oct 2004, james woodyatt wrote:
> On 11 Oct 2004, at 06:38, Christophe Raffalli wrote:
> > Jean-Christophe Filliatre wrote [quite sensibly]:
> >>
> >> [...]
> >> This shouldn't be advised, and not even posted on this list.
> >
> > And how do you write a tail recursive map doing only one structure
> > traversal (which is important with the penalty for memory access) on
> > immutable list without the Obj module ?
> By using a more appropriate data structure, e.g. a lazy list.  It's a
> pay-me-now-or-pay-me-later sort of game you're playing here.

Count me among those entirely unswayed by this.

You could also respectfully request that the implementors provide a safe
way to get this well known optimization WITHOUT having to resort to Obj
usage, and, until it is provided, use the safe solution provided a few times
already (and used in ExtLib I believe).

When I asked one of the implementors about this, I received the response that
this would be nice to have but not at the head of the queue in terms of
upcoming desireable features. That seems like a reasonable response, considering
that there are a number of not so bad workarounds, including use of Obj. I'd
rather have GCaml extensions sooner anyways...

I think Clean now provides some solution for the tail recursion modulo cons
stuff. Anyone know other language/implementations which do?

-- Brian

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