From: jeanmarc.eber@lexifi.com
To: caml-list@inria.fr
Subject: [Caml-list] two lacks of precision in the OCaml documentation
Date: Thu, 01 Mar 2001 13:38:33 +0100 (MET) [thread overview]
Message-ID: <983450313.3a9e42c91ecb5@imp.pro.proxad.net> (raw)
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
reply other threads:[~2001-03-01 12:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=983450313.3a9e42c91ecb5@imp.pro.proxad.net \
--to=jeanmarc.eber@lexifi.com \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox