Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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 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