caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] two lacks of precision in the OCaml documentation
@ 2001-03-01 12:38 jeanmarc.eber
  0 siblings, 0 replies; only message in thread
From: jeanmarc.eber @ 2001-03-01 12:38 UTC (permalink / raw)
  To: caml-list

0. Firstly thanks to all the OCaml team for the comming 3.01 version.
Especially the enhanced pattern-matcher will allow to express much more
elegantly some algorithms.


1. Syntax of pattern-matching

The question of whether a first vertical bar ("|") is necessary before even
the *first* pattern of a "multiple" pattern-matching is an old one on this
list. I'm personnaly in favour of this solution, but know that many others,
including some Inria OCaml team members, don't agree about that.
The situation today is that the first "bar" is optionnal. I think that this
should at least be documented correctly.
As of today (OCaml 3.00), the syntax diagram in the documentation (page 98)
don't include this optionnal bar ("pattern-matching"). Shoudn't it ?

2. Semantics of streams

In module [Stream], you "get" some stream builders. One of them enables you
to build streams from a "generator" function:

val from : (int -> 'a option) -> 'a t;;
        (* [Stream.from f] returns a stream built from the function [f].
           To create a new stream element, the function [f] is called with
           the current stream count. The user function [f] must return either
           [Some <value>] for a value or [None] to specify the end of the
           stream. *)

It is not specified (as I think, after a quick inspection of stream.ml, but I
may be wrong), that the argument [from] will only be called *once* for each
"element" (with the first argument begining with 0 and increasing each time
of course). In other words, any memoization will be done by the [stream]
implementation, and hasn't to be done by the "client" (in his [from] function).
Right ? This should be clarified, as the first argument (often useful of
course, look at a "string stream"!) could be misleading.

Jean-Marc Eber
LexiFi Technologies
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-03-01 12:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-01 12:38 [Caml-list] two lacks of precision in the OCaml documentation jeanmarc.eber

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