From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id WAA17744 for caml-red; Tue, 8 Aug 2000 22:42:59 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id UAA16686 for ; Tue, 8 Aug 2000 20:30:21 +0200 (MET DST) Received: from animal.cs.chalmers.se (animal.cs.chalmers.se [129.16.225.30]) by nez-perce.inria.fr (8.10.0/8.10.0) with ESMTP id e78IUKX22889 for ; Tue, 8 Aug 2000 20:30:20 +0200 (MET DST) Received: from muppet70.cs.chalmers.se (muppet70.cs.chalmers.se [129.16.226.211]) by animal.cs.chalmers.se (8.8.5/8.8.5) with ESMTP id UAA17437; Tue, 8 Aug 2000 20:30:18 +0200 (MET DST) Received: from localhost (taha@localhost) by muppet70.cs.chalmers.se (8.8.5/8.8.5) with ESMTP id UAA00729; Tue, 8 Aug 2000 20:30:19 +0200 (MET DST) X-Authentication-Warning: muppet70.cs.chalmers.se: taha owned process doing -bs Date: Tue, 8 Aug 2000 20:30:19 +0200 (MET DST) From: Walid Taha To: John Prevost cc: Markus Mottl , caml-list@inria.fr Subject: Re: Imperative programming in Caml In-Reply-To: <87ya27vcgk.fsf@localhost.localdomain.> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: weis@pauillac.inria.fr Hi John, > If you write: > > imperative call; > let x = blah in > imperative call > > then you get a little distracted by the indentation. Got it! > Mmm. I don't think you're going to have much success at showing that > O'Caml is a reasonable language without using at least some > polymorphism. Perhaps this restatement of my previous code would > help, though: > > type optional_int = > | No_Int > | Some_Int of int I feel you were "righter" the first time. An "option" type is somehow semanticaly implict in having "null/nill" in every pointer. So, I think it is reasonable to interpreter "'a pointer" as "'a option ref". This also suggests a naturally way to translate imperative programs to functional programs systematically. Thanks again for the great feedback. Walid.