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 NAA32096; Thu, 1 Mar 2001 13:38:34 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA32246 for ; Thu, 1 Mar 2001 13:38:33 +0100 (MET) Received: from imp.pro.proxad.net (imp1-1.pro.proxad.net [212.27.35.86]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f21CcXn17292 for ; Thu, 1 Mar 2001 13:38:33 +0100 (MET) Received: by imp.pro.proxad.net (Postfix, from userid 33) id 2D8D5781D1; Thu, 1 Mar 2001 13:38:33 +0100 (MET) To: caml-list@inria.fr Subject: [Caml-list] two lacks of precision in the OCaml documentation Message-ID: <983450313.3a9e42c91ecb5@imp.pro.proxad.net> Date: Thu, 01 Mar 2001 13:38:33 +0100 (MET) From: jeanmarc.eber@lexifi.com MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: IMP/PHP IMAP webmail program 2.2.4-Online X-Originating-IP: 212.155.146.173 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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 ] 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