From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA24998; Fri, 13 Dec 2002 10:08:43 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA32598 for ; Fri, 13 Dec 2002 10:08:42 +0100 (MET) Received: from ns.mccme.ru ([195.133.68.22]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id gBD98fX22160 for ; Fri, 13 Dec 2002 10:08:41 +0100 (MET) Received: from mccme.ru (potanin@mccme.ru [195.178.198.7]) by ns.mccme.ru (8.8.5/8.8.5) with SMTP id MAA20955; Fri, 13 Dec 2002 12:00:13 +0300 Date: Fri, 13 Dec 2002 12:22:16 +0300 (MSK) From: Mike Potanin To: Brian Hurt cc: Blair Zajac , Caml Users Mailing List Subject: Re: [Caml-list] Resource acquisition is initialization In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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