From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.6.10/8.6.6) id UAA24460 for caml-redistribution; Fri, 20 Oct 1995 20:11:21 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.6.10/8.6.6) with ESMTP id OAA18486 for ; Fri, 20 Oct 1995 14:50:09 +0100 Received: from margaux.inria.fr (margaux.inria.fr [128.93.8.2]) by concorde.inria.fr (8.6.10/8.6.9) with ESMTP id OAA22761 for ; Fri, 20 Oct 1995 14:50:09 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by margaux.inria.fr (8.6.10/8.6.6) with ESMTP id OAA18708 for ; Fri, 20 Oct 1995 14:50:08 +0100 Received: from isis.u-strasbg.fr (isis.u-strasbg.fr [130.79.200.1]) by concorde.inria.fr (8.6.10/8.6.9) with ESMTP id OAA22754 for ; Fri, 20 Oct 1995 14:50:07 +0100 Received: from gr6 (gr6.u-strasbg.fr [130.79.6.86]) by isis.u-strasbg.fr (8.6.11/8.6.9) with SMTP id OAA28716; Fri, 20 Oct 1995 14:43:35 +0100 Received: by gr6 (4.1/SMI-3.2-jjp/4/6/92) id AA20016; Fri, 20 Oct 95 14:53:53 +0100 Date: Fri, 20 Oct 95 14:53:53 +0100 From: boos@gr6.u-strasbg.fr (Christian Boos) Message-Id: <9510201353.AA20016@gr6> To: "Makofka, Doug (HT-MS)" Cc: Caml-list Subject: output_value In-Reply-To: <30871CFF@gicpo2.gic.gi.com> References: <30871CFF@gicpo2.gic.gi.com> Sender: weis Doug Makofka writes: > could someone comment on the difference between: > do_list (output_value chan) ProductionLst > and > output_value chan ProductionLst The second form is often better, since all you need to do for retrieval and use is something like : do_list SomeCrazyFunctionOnProductionValue (input_value chan : ProductionValue list) However, if your 'ProductionLst' is constructed piece by piece, and if it may grows very large, then you need perhaps the first form, but in a slightly different way that the one you suggested. The 'do_list ...' you wrote only outputs ProductionValues, without any structure along them. So, you'd better write : type 'a option = Some of 'a | None;; do_list (fun p -> output_value chan (Some p)) ProductionLst; (* - maybe multiple times - *) (* and, when you're done : *) output_value chan None Latter, you can retrieve your production values one by one: let do_production_value_chan f chan = let rec do_one () = match (input_value chan:ProductionValue) with | Some p -> f p; do_one () | None -> () in do_one () ;; Hope it helps! --------------------------------- Christian Boos