Version française
Home     About     Download     Resources     Contact us    
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: Jon Harrop <jon@j...>
Subject: Re: [Caml-list] About Obj (was Recursive lists)
On Monday 11 October 2004 14:38, Christophe Raffalli wrote:
> Jean-Christophe Filliatre wrote:
> > This shouldn't be advised, and not even posted on this list.

Yes, why is "Brandon" in the filter but "Obj" isn't? :-)

> 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?

You avoid the use of Obj magic at all costs! Then you are much more likely to 
get programs which work. Finally, you optimise them in terms of what you can 
do in the language.

> Let me correct my statement: it could be used after some improvment,
> because it is two times slower on small lists (after some timing)

Yes, your Obj implementation is substantially bigger, more complicated, more 
error prone and more costly on small lists. Just forget this whole thread 
ever happened and consider using a different data structure. :-)

Can Obj not be hidden so that people can't use it so easily?

Cheers,
Jon.

-------------------
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