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 QAA28046 for caml-red; Wed, 9 Aug 2000 16:00:42 +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 PAA27551 for ; Wed, 9 Aug 2000 15:50:23 +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 e79DoMX08686; Wed, 9 Aug 2000 15:50:22 +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 PAA02426; Wed, 9 Aug 2000 15:50:21 +0200 (MET DST) Received: from localhost (taha@localhost) by muppet70.cs.chalmers.se (8.8.5/8.8.5) with ESMTP id PAA01185; Wed, 9 Aug 2000 15:50:22 +0200 (MET DST) X-Authentication-Warning: muppet70.cs.chalmers.se: taha owned process doing -bs Date: Wed, 9 Aug 2000 15:50:22 +0200 (MET DST) From: Walid Taha To: Pierre Weis cc: caml-list@inria.fr Subject: Re: Imperative programming in Caml In-Reply-To: <200008082110.XAA20025@pauillac.inria.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: weis@pauillac.inria.fr Dear Pierre, Thank you for you comments. > Your problem seems to have something to do with elementary programming > in Caml; you may have a look at the documentation, in particular the > FAQ where basic indentation hints are given in the programming guide > lines (http://pauillac.inria.fr/caml/FAQ/pgl-eng.html), and questions > about imperative programming in Caml including the existence of > imperative pointers and their encoding in Caml are discussed in > details (http://pauillac.inria.fr/caml/FAQ/pointers-eng.html). I took a quick look, and both seem to be very good pointers. I like the systematic translation suggested. > Note: if you really do not want to use any kind of polymorphism, I'm > afraid you will have a bad time to write and explain imperative > programming examples in Caml, since you cannot use references ('a > ref), nor arrays ('a array), nor options ('a option), nor lists ('a > list); if you also consistently banish polymorphism from your function > type schemes, what could you do without the basic predicates such that > (=) (that has type 'a -> 'a -> bool), or even any comparison > predicates (<, <=, <>, ...) that are also polymorphic ? This is a good point. I had overlooked the fact that "ref" itself is a polymorphic type constructor. Best regards, Walid.