Browse thread
Re: [Caml-list] indent 2
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Markus Mottl <markus@m...> |
| Subject: | Re: [Caml-list] indent 2 |
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