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] @, 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: 2003-01-31 (17:42)
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 Archives:
Bug reports: FAQ:
Beginner's list: