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 NAA17404; Sun, 22 Jul 2001 13:20:17 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 NAA17394 for ; Sun, 22 Jul 2001 13:20:17 +0200 (MET DST) Received: from fichte.ai.univie.ac.at (fichte.ai.univie.ac.at [131.130.174.156]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f6MBKFj23390; Sun, 22 Jul 2001 13:20:16 +0200 (MET DST) Received: (from markus@localhost) by fichte.ai.univie.ac.at (8.9.3/8.9.3/Debian 8.9.3-21) id NAA32038; Sun, 22 Jul 2001 13:20:10 +0200 Date: Sun, 22 Jul 2001 13:20:10 +0200 From: Markus Mottl To: Pierre Weis Cc: caml-list@inria.fr Subject: Re: [Caml-list] indent 2 Message-ID: <20010722132010.A24487@fichte.ai.univie.ac.at> References: <200107221006.MAA17045@pauillac.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200107221006.MAA17045@pauillac.inria.fr>; from Pierre.Weis@inria.fr on Sun, Jul 22, 2001 at 12:06:05 +0200 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sun, 22 Jul 2001, Pierre Weis wrote: > Personnaly, I use one space with some exceptions for 2 spaces > indentation (which is inconsistent, I know it!) for reasons that are > explained in the Caml programming guidelines. (In short, I write > 2 spaces to align the |'s in the pattern matchings of function > definitions: Always eager to improve the syntactic beauty of my sources, I wondered how this indentation style looks like so I peeked at the implementation of the Format-module, which seems to be written by you. Indeed, this style is obviously very coherent: one can find anything from 1, 2 to 4 spaces of indentation consistently applied throughout the whole file, e.g.: let add_queue x q = let c = Cons {head = x; tail = Nil} in ... let pp_print_as state n s = if state.pp_curr_depth < state.pp_max_boxes ... let pp_print_newline state () = pp_flush_queue state true; state.pp_flush_function () ... The rules can be easily inferred: one space if the function body starts with a "let", two if it starts with "if" and four in any other case. Is it this kind of consistency you mean in the Programming Guidelines? :-) Best regards, Markus Mottl P.S.: Sorry for my sarcasm! As usual I couldn't resist... ;) -- Markus Mottl markus@oefai.at Austrian Research Institute for Artificial Intelligence http://www.oefai.at/~markus ------------------- 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