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 RAA05072; Sat, 12 May 2001 17:33:31 +0200 (MET DST) 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 RAA05182 for ; Sat, 12 May 2001 17:33:30 +0200 (MET DST) Received: from mail-gw.xrce.xerox.com (pinea.xerox.fr [193.49.123.194]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f4CFXTb06190 for ; Sat, 12 May 2001 17:33:29 +0200 (MET DST) Received: from meije.grenoble.xrce.xerox.com ([13.202.220.10]) by mail-gw.xrce.xerox.com (8.9.3/8.9.3) with ESMTP id RAA11951; Sat, 12 May 2001 17:29:04 +0200 (MET DST) Received: from xrce.xerox.com (pelee.grenoble.xrce.xerox.com [13.202.220.65]) by meije.grenoble.xrce.xerox.com (8.9.1a/8.9.1) with ESMTP id RAA21362; Sat, 12 May 2001 17:32:39 +0200 (MET DST) Message-ID: <3AFD574E.E5CCECFC@xrce.xerox.com> Date: Sat, 12 May 2001 17:31:26 +0200 From: Sylvain Pogodalla X-Mailer: Mozilla 4.6 [en] (X11; I; SunOS 5.8 sun4u) X-Accept-Language: fr, en MIME-Version: 1.0 To: Terrence Brannon , caml-list@inria.fr Subject: Re: [Caml-list] converting a list to a Stream References: <20010511225250.A50306@caddr.com> <15101.21254.203779.784643@gargle.gargle.HOWL> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Terrence Brannon wrote: > > How does one convert a list to a stream? > > # let c = [1; 2; 3 ];; > val c : int list = [1; 2; 3] > # Stream_of_list c;; > Characters 0-16: > Unbound constructor Stream_of_list > # stream_of_list c;; > Characters 0-14: > Unbound value stream_of_list To use a function defined for a module, you call it with the syntax : Module.function arg Here, you have : # let l=[1; 2; 3 ];; val l : int list = [1; 2; 3] # Stream.of_list l;; - : int Stream.t = Or, if you don't want to have to prefix the function with the module name, you can open it : # open Stream;; # let l=[1; 2; 3 ];; val l : int list = [1; 2; 3] # of_list l;; S. ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr