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 NAA32443; Sat, 21 Jul 2001 13:09:09 +0200 (MET DST) 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 NAA32434 for ; Sat, 21 Jul 2001 13:09:08 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f6LB93H15443; Sat, 21 Jul 2001 13:09:03 +0200 (MET DST) Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA32432; Sat, 21 Jul 2001 13:09:03 +0200 (MET DST) From: Pierre Weis Message-Id: <200107211109.NAA32432@pauillac.inria.fr> Subject: Re: [Caml-list] indent 2 In-Reply-To: <3B590D09.319D2083@quasar.ipa.nw.ru> from "Alexander V. Voinov" at "Jul 20, 101 10:03:05 pm" To: avv@quasar.ipa.nw.ru (Alexander V. Voinov) Date: Sat, 21 Jul 2001 13:09:03 +0200 (MET DST) Cc: bpr@best.com, caml-list@inria.fr X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > Hi All, > > Is the indentation with the step 2 a _must_ for those who program in > OCaml? I got used 4, and already set all the necessary variables for > caml-mode, so that I get: > > let count_range bt lwb upb = > let bti = (IVB.from_to bt lwb upb) in > let rec count1 bti n = > if IVB.ok bti then begin > match IVB.next bti with > Some (k, v, b) -> > (printf "in count1 %d %d %b\n" k v b); flush stdout; > let n' = if b then n + 1 else n in > count1 bti n' > | None -> raise (Failure "this cannot happen") > end > else > n > in > count1 bti 0 > > Is this horrible/terrible/tolerable/appropriate? > > Alexander > ------------------- > Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ > To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Instead of answering by a two lines long comment and my version of the best version of your program, I prefer to redirect you to a more appropriate and documented source concerning Caml programming styles. This is a good occasion for me to announce a major rewritting of the Caml programming guide lines where this question is discussed in the large among a lot of others concerning style, including where to break lines in Caml programs, where and why use (or avoid) parens, etc. http://pauillac.inria.fr/caml/FAQ/pgl-eng.html http://pauillac.inria.fr/caml/FAQ/pgl-fra.html Each programming problem is normally carefully discussed with arguments (and counter-arguments, and sometimes counter-counter-arguments) gathered from observation of a lot of Caml programs including the Caml compilers source code, and from statements and advices from some of the best Caml programmers in the world, not mentionning one of the best source of counter-counter-meta-arguments I know about Caml programs indentation and syntax problems: the sudden and not always so kind flamewares that appear, while quietly sitting for lunch in the INRIA's cafeteria ! However, if there is something new to add to these guidelines, feel free to drop me a not: I would be glad to translate it in french or english or even incorporate it as is, if you provide a translation. Don't hesitate to signal an error either, since this is the worse situation to face for a guideline writter to incorporate a bug in the suggested programming style! Thanks in advance for your help, Pierre Weis INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://pauillac.inria.fr/~weis/ ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr