caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Re:  [Caml-list] indent 2
@ 2001-07-21 11:29 Damien Doligez
  2001-07-21 16:45 ` Alexander V. Voinov
  0 siblings, 1 reply; 11+ messages in thread
From: Damien Doligez @ 2001-07-21 11:29 UTC (permalink / raw)
  To: avv, bpr, caml-list

>From: "Alexander V. Voinov" <avv@quasar.ipa.nw.ru>

>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

Hey, the Soviet Union doesn't exist any more.  Welcome to the free
world, comrade.

-- Damien
-------------------
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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] indent 2
  2001-07-21 11:29 [Caml-list] indent 2 Damien Doligez
@ 2001-07-21 16:45 ` Alexander V. Voinov
  2001-07-21 18:07   ` Brian Rogoff
  0 siblings, 1 reply; 11+ messages in thread
From: Alexander V. Voinov @ 2001-07-21 16:45 UTC (permalink / raw)
  To: Damien Doligez; +Cc: bpr, caml-list

Hi Damien,

Damien Doligez wrote:
> 
> >From: "Alexander V. Voinov" <avv@quasar.ipa.nw.ru>
> 
> >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
> 
> Hey, the Soviet Union doesn't exist any more.  Welcome to the free
> world, comrade.

Oh, if it were that simple. The pressure of the society may be much
stronger than the pressure of an external authority, which contrasts
itself to the society. Because the former penetrates deeper into one's
mentality. (Sorry for offtopic)

In this particular case the concern is that my (supposedly genious :-)
sources would not be readable by the OCaml community, and while I'm not
yet got used to any particular style I can accept some widely adopted.

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] indent 2
  2001-07-21 16:45 ` Alexander V. Voinov
@ 2001-07-21 18:07   ` Brian Rogoff
  2001-07-22 10:06     ` Pierre Weis
  2001-07-22 19:40     ` Jeremy Fincher
  0 siblings, 2 replies; 11+ messages in thread
From: Brian Rogoff @ 2001-07-21 18:07 UTC (permalink / raw)
  To: Alexander V. Voinov; +Cc: Damien Doligez, bpr, caml-list

No idea why I was specifically addressed for this, but since you ask...

On Sat, 21 Jul 2001, Alexander V. Voinov wrote:
> Hi Damien,
> 
> Damien Doligez wrote:
> > 
> > >From: "Alexander V. Voinov" <avv@quasar.ipa.nw.ru>
> > 
> > >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
> > 
> > Hey, the Soviet Union doesn't exist any more.  Welcome to the free
> > world, comrade.
> 
> Oh, if it were that simple. The pressure of the society may be much
> stronger than the pressure of an external authority, which contrasts
> itself to the society. Because the former penetrates deeper into one's
> mentality. (Sorry for offtopic)

That's too deep for me, I'm just an American. 

When I first started programming seriously with lots of other people
reading and modifying programs that I wrote, people would argue a lot
about non-issues like where to put the braces. My basic rule is that 
I'd like the programs to look as though they'd been written by one person, 
with a consistent style. I can basically adapt to anything and in two 
weeks or so a new style will seem normal. I note that the new guidelines 
Pierre mentions say much the same thing 

  Choose a generally accepted style of indentation, then use it
  systematically throughout the whole application. 

It seems that the Caml community mostly indents by two spaces, so if 
you'd like to be a good neighbor you should do so as well. No one will 
shun you if you refuse and use four spaces, and your code will still 
be readable. Well, OK, I'll shun you, but probably noone else :-).

Its wise to invest some time reading the compiler sources. I wish I had
done so earlier. 

-- Brian

PS: It would be useful to have the programming guidelines extended to
    cover programming with classes and modules. 


-------------------
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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] indent 2
  2001-07-21 18:07   ` Brian Rogoff
@ 2001-07-22 10:06     ` Pierre Weis
  2001-07-22 11:20       ` Markus Mottl
  2001-07-23  0:27       ` Brian Rogoff
  2001-07-22 19:40     ` Jeremy Fincher
  1 sibling, 2 replies; 11+ messages in thread
From: Pierre Weis @ 2001-07-22 10:06 UTC (permalink / raw)
  To: Brian Rogoff; +Cc: avv, Damien.Doligez, bpr, caml-list

> No idea why I was specifically addressed for this, but since you ask...
> 
> On Sat, 21 Jul 2001, Alexander V. Voinov wrote:
> > Hi Damien,
> > 
> > Damien Doligez wrote:
> > > 
> > > >From: "Alexander V. Voinov" <avv@quasar.ipa.nw.ru>
> > > 
> > > >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
> > > 
> > > Hey, the Soviet Union doesn't exist any more.  Welcome to the free
> > > world, comrade.
> > 
> > Oh, if it were that simple. The pressure of the society may be much
> > stronger than the pressure of an external authority, which contrasts
> > itself to the society. Because the former penetrates deeper into one's
> > mentality. (Sorry for offtopic)
> 
> That's too deep for me, I'm just an American. 

I can't resist to cite this slogan that I learnt long time ago from
the chinese communists (I really do not remember if it were about Caml
programming guidelines or not):

 Always follow the party's line,
 but don't be afraid to swim against the main stream.

[...]
> It seems that the Caml community mostly indents by two spaces, so if 
> you'd like to be a good neighbor you should do so as well. No one will 
> shun you if you refuse and use four spaces, and your code will still 
> be readable. Well, OK, I'll shun you, but probably noone else :-).

I will shun you also, but probably nobody else. Oh yes, now I remember,
for indentation the chinese slogan was:

 Consistenly use one or two extra spaces when indenting,
 but fill free to indent as you like it.

(Sorry for not being so serious about that (in fact) important subject.)

More seriously: Caml is a language of expressions (not blocks of
instructions), and expressions tend to nest rather deeply. Hence it is
not uncommon to have indentation level growing up to 5 in a regular
program (in some bad cases it could go up to 10). Then suppose you use
4 spaces as indentation: 10 times 4 is 40 and the left margin is in
the middle of the page. That's way too much. That's why people use 2
spaces since 20 spaces in the left margin is ok. 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:

let rec length = function
  | [] ->
  | x :: l ->

but I write one space to indent within an arithmetic expression, if
then else, applications ..., no space at all (or alignment to the
keyword) for pattern matching clauses of try and match.)

However, I use these rules consistently and have made the effort to
write them out with pro and cons arguments, so that you can read those
and design your own consistent set of rules.

Kidding again: evidently, the best you can do is to choose your set of rules
so that it appears to be exactly ours (a variation on the chinese
slogan for indentation :)

> Its wise to invest some time reading the compiler sources. I wish I had
> done so earlier. 

Absolutely.

> -- Brian
> 
> PS: It would be useful to have the programming guidelines extended to
>     cover programming with classes and modules. 

I added some paragraph on modules. May be you can tell me what topics
I have to add or extend about modules ? For classes, I'm a bit more
puzzled and I need help from people that use classes more than I do,
and that already know what are the problems to avoid and the styles to
recommend.

Waiting for your helpful comments and suggestions,

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] indent 2
  2001-07-22 10:06     ` Pierre Weis
@ 2001-07-22 11:20       ` Markus Mottl
  2001-07-23  0:27       ` Brian Rogoff
  1 sibling, 0 replies; 11+ messages in thread
From: Markus Mottl @ 2001-07-22 11:20 UTC (permalink / raw)
  To: Pierre Weis; +Cc: caml-list

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] indent 2
  2001-07-21 18:07   ` Brian Rogoff
  2001-07-22 10:06     ` Pierre Weis
@ 2001-07-22 19:40     ` Jeremy Fincher
  1 sibling, 0 replies; 11+ messages in thread
From: Jeremy Fincher @ 2001-07-22 19:40 UTC (permalink / raw)
  To: caml-list

> Its wise to invest some time reading the compiler sources. I wish I had
> done so earlier.

What should a programmer be looking for when reading the compiler sources?

Jeremy
-------------------
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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] indent 2
  2001-07-22 10:06     ` Pierre Weis
  2001-07-22 11:20       ` Markus Mottl
@ 2001-07-23  0:27       ` Brian Rogoff
  2001-07-23  7:52         ` Luc Maranget
  2001-07-23 10:20         ` Markus Mottl
  1 sibling, 2 replies; 11+ messages in thread
From: Brian Rogoff @ 2001-07-23  0:27 UTC (permalink / raw)
  To: Pierre Weis; +Cc: avv, Damien.Doligez, caml-list

On Sun, 22 Jul 2001, Pierre Weis wrote:
> > On Sat, 21 Jul 2001, Alexander V. Voinov wrote:
> > > Oh, if it were that simple. The pressure of the society may be much
> > > stronger than the pressure of an external authority, which contrasts
> > > itself to the society. Because the former penetrates deeper into one's
> > > mentality. (Sorry for offtopic)
> > 
> > That's too deep for me, I'm just an American. 
> 
> I can't resist to cite this slogan that I learnt long time ago from
> the chinese communists (I really do not remember if it were about Caml
> programming guidelines or not):

>  Always follow the party's line,
>  but don't be afraid to swim against the main stream.

Is four spaces not following the party's line, or is it just swimmming
against the main stream? 

> [...]
> > It seems that the Caml community mostly indents by two spaces, so if 
> > you'd like to be a good neighbor you should do so as well. No one will 
> > shun you if you refuse and use four spaces, and your code will still 
> > be readable. Well, OK, I'll shun you, but probably noone else :-).
> 
> I will shun you also, but probably nobody else.

Hey, we may be onto something with this shunning thing...

> Oh yes, now I remember,
> for indentation the chinese slogan was:
> 
>  Consistenly use one or two extra spaces when indenting,
>  but fill free to indent as you like it.
> 
> (Sorry for not being so serious about that (in fact) important subject.)
> 
> More seriously: Caml is a language of expressions (not blocks of
> instructions), and expressions tend to nest rather deeply. Hence it is
> not uncommon to have indentation level growing up to 5 in a regular
> program (in some bad cases it could go up to 10). 

I've never had 10, but definitely nesting 4 or 5 deep is common and ugly
with four space indenting IMO. 

> Personnaly, I use one
> space with some exceptions for 2 spaces indentation (which is
> inconsistent, I know it!) 

Well, you know what Emerson said about foolish consistencies. Then again, 
I do have a little mind!

> > PS: It would be useful to have the programming guidelines extended to
> >     cover programming with classes and modules. 
> 
> I added some paragraph on modules. May be you can tell me what topics
> I have to add or extend about modules ? 

A little extra section on programming with functors and the interaction
with the file system would be helpful. I've read the manual and the 
libraries, and there is not really a consistency of style there. For
instance module types in the manual are UPPER_CASE, but MixedCaseWithSuffix 
in the libraries. In another document the style used "Sig" as a suffix to 
MixedCaseSuffix as opposed to Type in the libraries. Is there a preferred
style yet? I've been playing with some heavily functorized libraries
ported over from SML and since I'd like to make them Caml style I'd like
examples of the desired naming styles. 
 
There was also some discussion on the duplication of module information in 
the .mli and .ml files on the list which is a fine addition to either the
FAQ or style guide. 

I'm not sure why you don't mention local modules in the section on opening
modules since I think that in many cases a local open is better than a 
file/top-level-unit wide open. Is using let module this way questionable 
style?

> For classes, I'm a bit more puzzled and I need help from people that
> use classes more than I do, and that already know what are the problems
> to avoid and the styles to recommend.

I'm still accumulating experience here. I only use classes in a few
places.

-- Brian


-------------------
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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] indent 2
  2001-07-23  0:27       ` Brian Rogoff
@ 2001-07-23  7:52         ` Luc Maranget
  2001-07-23 10:20         ` Markus Mottl
  1 sibling, 0 replies; 11+ messages in thread
From: Luc Maranget @ 2001-07-23  7:52 UTC (permalink / raw)
  To: Brian Rogoff; +Cc: Pierre Weis, avv, Damien.Doligez, caml-list

Ah, the good old days,...

> 
> On Sun, 22 Jul 2001, Pierre Weis wrote:
> > > On Sat, 21 Jul 2001, Alexander V. Voinov wrote:
> > > > Oh, if it were that simple. The pressure of the society may be much
> > > > stronger than the pressure of an external authority, which contrasts
> > > > itself to the society. Because the former penetrates deeper into one's
> > > > mentality. (Sorry for offtopic)
> > > 
> > > That's too deep for me, I'm just an American. 
  You should not be ashamed of it, after all you are a US Citizen
(or Resident...).

  No hay nigun problema, de toda manera Usted es Estadounidense.



> > 
> > I can't resist to cite this slogan that I learnt long time ago from
> > the chinese communists (I really do not remember if it were about Caml
> > programming guidelines or not):
> 
> >  Always follow the party's line,
> >  but don't be afraid to swim against the main stream.
> 
> Is four spaces not following the party's line, or is it just swimmming
> against the main stream? 
  No trouble, dialectics tells us that the party's line may or may not
coincide with the main stream. As a wanna be party ideologist I would
say that  four spaces is swimming against the main stream.



> > [...]
> > > It seems that the Caml community mostly indents by two spaces, so if 
> > > you'd like to be a good neighbor you should do so as well. No one will 
> > > shun you if you refuse and use four spaces, and your code will still 
> > > be readable. Well, OK, I'll shun you, but probably noone else :-).
> > 
> > I will shun you also, but probably nobody else.
> 
> Hey, we may be onto something with this shunning thing...
> 
> > Oh yes, now I remember,
> > for indentation the chinese slogan was:
> > 
> >  Consistenly use one or two extra spaces when indenting,
> >  but fill free to indent as you like it.
  That's enligtning. Great example of the party's leadership
and wisdom. Long life to president Weis.



  More seriously, two spaces indentation is harmony. But the weather
^^ (one, two)
in Rocquencourt is two smooth and we lack manpower, so that organizing a
camp here for dissidents is not possible. Sorry, you are on your own.


--Luc

-------------------
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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] indent 2
  2001-07-23  0:27       ` Brian Rogoff
  2001-07-23  7:52         ` Luc Maranget
@ 2001-07-23 10:20         ` Markus Mottl
  1 sibling, 0 replies; 11+ messages in thread
From: Markus Mottl @ 2001-07-23 10:20 UTC (permalink / raw)
  To: Brian Rogoff; +Cc: caml-list

On Sun, 22 Jul 2001, Brian Rogoff wrote:
> A little extra section on programming with functors and the interaction
> with the file system would be helpful. I've read the manual and the 
> libraries, and there is not really a consistency of style there. For
> instance module types in the manual are UPPER_CASE, but MixedCaseWithSuffix 
> in the libraries. In another document the style used "Sig" as a suffix to 
> MixedCaseSuffix as opposed to Type in the libraries. Is there a preferred
> style yet? I've been playing with some heavily functorized libraries
> ported over from SML and since I'd like to make them Caml style I'd like
> examples of the desired naming styles. 

I don't know whether this is "a" standard style, but I have at least
seen it often and also use it consistently: module types are written in
capital letters where different words are separated by an underscore,
e.g.: "PARTIAL_ORDER".

Module implementations are written without underscores and with small
letters, but the first char of each subword is capitalized, e.g:
"PartialOrder".

> There was also some discussion on the duplication of module information in 
> the .mli and .ml files on the list which is a fine addition to either the
> FAQ or style guide. 

I didn't have the impression so far that any kind of "standard"
concerning the use of modules has appeared. Especially what concerns
functorized code, people use different approaches. See, for example,
the standard library (Set, Map) that puts both the result signatures of
functors and the functor signatures into the .mli file associated with the
implementation and therefore by necessity also into the implementation
files. I am not sure what the advantages are besides having to maintain
two files only. To me this looks like bad practice, because then I really
have to update two files if the signature changes (e.g. is extended),
which is not the case in approaches that use more than two files.

Furthermore, I think it is very cumbersome that implementations always
get opaque type. It might be a good idea to develop a scheme that allows
us to easily exploit concrete representations to e.g. extend them with
additional functionality that cannot be replicated efficiently (or at
all) with the abstract type alone. I'll describe an approach that I have
recently come across in another mail...

Regards,
Markus Mottl

-- 
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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] indent 2
  2001-07-21  5:03 ` [Caml-list] indent 2 Alexander V. Voinov
@ 2001-07-21 11:09   ` Pierre Weis
  0 siblings, 0 replies; 11+ messages in thread
From: Pierre Weis @ 2001-07-21 11:09 UTC (permalink / raw)
  To: Alexander V. Voinov; +Cc: bpr, caml-list

> 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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Caml-list] indent 2
  2001-07-21  4:50 [Caml-list] Dequeues (was Generation of streams is slow) Brian Rogoff
@ 2001-07-21  5:03 ` Alexander V. Voinov
  2001-07-21 11:09   ` Pierre Weis
  0 siblings, 1 reply; 11+ messages in thread
From: Alexander V. Voinov @ 2001-07-21  5:03 UTC (permalink / raw)
  To: Brian Rogoff, caml

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2001-07-23 10:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-21 11:29 [Caml-list] indent 2 Damien Doligez
2001-07-21 16:45 ` Alexander V. Voinov
2001-07-21 18:07   ` Brian Rogoff
2001-07-22 10:06     ` Pierre Weis
2001-07-22 11:20       ` Markus Mottl
2001-07-23  0:27       ` Brian Rogoff
2001-07-23  7:52         ` Luc Maranget
2001-07-23 10:20         ` Markus Mottl
2001-07-22 19:40     ` Jeremy Fincher
  -- strict thread matches above, loose matches on Subject: below --
2001-07-21  4:50 [Caml-list] Dequeues (was Generation of streams is slow) Brian Rogoff
2001-07-21  5:03 ` [Caml-list] indent 2 Alexander V. Voinov
2001-07-21 11:09   ` Pierre Weis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).