Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] @, List.append, and tail recursion
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: brogoff@s...
Subject: Re: [Caml-list] @, List.append, and tail recursion
On Fri, 31 Jan 2003, Brian Hurt wrote:
> On Thu, 30 Jan 2003, james woodyatt wrote:
> > Apparently, nobody seemed to notice what I was talking about.  So I'm 
> > going to try to make my point again.  Sorry if you got it the first 
> > time.
> 
> I did get it the first time.  I'm just using List.append to illustrate a 
> problem I'm having.

You don't even need to be mapping to a particularly long list, since your 
mapping function may be consuming stack space too. 

The stuff using set_cdr was only ugly if you look under the hood. No one 
complains about other hidden uses of Obj, so that aproach may make sense 
as an immediate fix. 

The main point to me is that since there appears to be a reasonable approach to 
doing all of this stuff in a safe way that extends the power of ML, it may be a 
good idea to consider removing this limitation in a future (Ca)ML. There are 
only a few places where the language itself has annoying limitations, and I'm 
beginning to believe that this is one of them. The implementation provides a 
workaround as Olivier demonstrated, but the inability to express this in OCaml 
is a hole that perhaps needs to be filled (pun intended :).

-- Brian


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