From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.2 required=5.0 tests=AWL,SPF_SOFTFAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id B938ABC69 for ; Mon, 22 Oct 2007 09:48:41 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAFryG0fAXQImh2dsb2JhbACBWox9AQEBCAopgSc X-IronPort-AV: E=Sophos;i="4.21,309,1188770400"; d="scan'208";a="3462459" Received: from discorde.inria.fr ([192.93.2.38]) by mail1-smtp-roc.national.inria.fr with ESMTP; 22 Oct 2007 09:48:41 +0200 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l9M7me8P003082 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Mon, 22 Oct 2007 09:48:41 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah4FAFryG0fAI/YB/2dsb2JhbACBWo5i X-IronPort-AV: E=Sophos;i="4.21,309,1188770400"; d="scan'208";a="18447824" Received: from ns.inescn.pt (HELO animal.inescn.pt) ([192.35.246.1]) by mail4-smtp-sop.national.inria.fr with ESMTP; 22 Oct 2007 09:48:40 +0200 Received: from localhost (localhost [127.0.0.1]) by animal.inescn.pt (8.13.8/8.13.6/9) with ESMTP id l9M7mcrU015204; Mon, 22 Oct 2007 08:48:38 +0100 (WEST) X-Virus-Scanned: amavisd-new at inescporto.pt Received: from animal.inescn.pt ([127.0.0.1]) by localhost (animal.inescn.pt [127.0.0.1]) (amavisd-new, port 10024) with LMTP id TCK-p2F0XrPt; Mon, 22 Oct 2007 08:48:15 +0100 (WEST) Received: from [194.117.30.94] (morfina.inescn.pt [194.117.30.94]) by animal.inescn.pt (8.13.8/8.13.8/40) with ESMTP id l9M7m9dm015188; Mon, 22 Oct 2007 08:48:10 +0100 (WEST) Message-ID: <471C55B3.2080603@inescporto.pt> Date: Mon, 22 Oct 2007 08:48:03 +0100 From: Hugo Ferreira User-Agent: Thunderbird 2.0.0.6 (X11/20070806) MIME-Version: 1.0 To: Zheng Li Cc: caml-list@inria.fr Subject: Re: [Caml-list] Re: Functional design for a basic simulation pipe. References: <470C8199.4080708@inescporto.pt> <87fy0hvr15.fsf@pps.jussieu.fr> <470E29B6.4060502@inescporto.pt> <87abqkugi5.fsf@pps.jussieu.fr> In-Reply-To: <87abqkugi5.fsf@pps.jussieu.fr> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 471C55D8.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; hmmm:01 combinators:01 combinators:01 recursion:01 simulated:01 ocaml's:01 recursive:01 simulate:01 ocaml:01 workarounds:01 recursive:01 variants:01 camlp:01 blog:98 burdens:98 Hi Zheng, Apologies for not answering earlier (Took a fee days off). I am going to look at your code and see how that works. Thanks once again. Hugo F. Zheng Li wrote: > Hi, > > Hugo Ferreira writes: >> Hmmm... these combinators seem to be well understood. Know of any >> description (article, blog, etc) of these in a functional programming >> setting? > These combinators pervasively exist in functional languages and other > declarative style languages. There's no authoritative definition though, > they vary from language to language, with some slight differences. > >> I see that recursion as shown above could be useful: one of the >> outputs would simply be an input to another stream generator. > Yes. This _could_ be directly simulated with OCaml's recursive values if not > for the restriction I mentioned before. > >> I (think) I see what you mean. Things seem to be coming together. What >> you are saying is that I could use this "delay" so that only when the >> value is available would it be "passed back" to the "stream generator" >> thereby providing the "feedback" I need. In fact this "delay" is more >> general and could be used to define various types of flows. Nice! > The "delay" like facilities are usually provided as language primitives in > dataflow languages, not in the library space. I can't figure out how to > simulate it through plain OCaml and still keeping a combinatorial interface at > the same time. I can image some workarounds to relax the restriction: recursive > function, reference, variants, but all of them come with some syntactic burdens > and can hardly used as combinators directly. On the other hand, there is still > some possibility of making camlp4 extension to do that. I just haven't got > chance to do any investigation on that. > > Btw, I just cleaned up some old code and will release it right now. I'm not > sure whether it can help directly in your case, but I hope so. > > Regards