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] Resource acquisition is initialization
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-12-13 (09:08)
From: Mike Potanin <potanin@m...>
Subject: Re: [Caml-list] Resource acquisition is initialization
On Wed, 11 Dec 2002, Brian Hurt wrote:

> On Wed, 11 Dec 2002, Blair Zajac wrote:
> There are three problems I have with this idea.  The first problem is that
> it greatly complicates exception handling, as now the exceptions have to
> call destructors for all the objects on the stack as they pop the stack
> frames off.  The second problem I have with this is what happens when an
> object goes out of scope in it's original context, but isn't yet garbage?
> We've all seen C code like:
> char * foo(...) {
>     char buf[];
>     /* do something to fill buf */
>     return buf;
> }
> This sounds like a wonderful way to introduce dangling pointer bugs in the
> language.
Cyclone language handle this problec staticaly (compile time). It no need
GC use.

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