From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q3I1xdQe000782 for ; Wed, 18 Apr 2012 03:59:39 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah0CAGQfjk/Y5v4vmGdsb2JhbABEgxyCSqhFgxQiAQEBAQEGCw0HFCeCCQEBBSMECwEFQBELGAICBRYLAgIJAwIBAgFFEwgBAYgJAacgkl6BL4wQggyBGASIWo0VhXKNOg X-IronPort-AV: E=Sophos;i="4.75,438,1330902000"; d="scan'208";a="154489625" Received: from amout07.alpha-mail.net ([216.230.254.47]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 18 Apr 2012 03:59:33 +0200 Received: from webarc04.alpha-mail.jp (webarc04 [216.230.254.84]) by amout07.alpha-mail.net with ESMTP id q3I1xMNi027809; Wed, 18 Apr 2012 10:59:29 +0900 X-Virus-Scanned: amavisd-new at Alpha-Mail Out Received: from ltsub01.alpha-mail.net (ltsub01 [216.230.254.29]) by webarc04.alpha-mail.jp (Postfix) with ESMTP id D20141C080CB; Wed, 18 Apr 2012 10:59:25 +0900 (JST) Received: from [192.168.13.3] (u624024.xgsfmg26.imtp.tachikawa.mopera.net [183.73.124.24]) by ltsub01.alpha-mail.net (Alpha-mail) with ESMTP id B9E083B809C; Wed, 18 Apr 2012 10:59:26 +0900 (JST) Message-ID: <4F8E1FF4.5070702@itpl.co.jp> Date: Wed, 18 Apr 2012 10:59:16 +0900 From: Satoshi Ogasawara User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 To: daniel.buenzli@erratique.ch References: <4F8D9D0E.1040007@itpl.co.jp> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Caml-list] [ANN] PEC ver. 1.1 Hello, (2012/04/18 4:23), Daniel Bünzli wrote: >> - PEC's update cycle is separated from sending events. >> You can send a value to event during update cycle. > What's the semantics if you send two different values to an event during an update cycle ? They fires two different event if you send two different value to an event even if same update cycle. Events send are stored in an event queue, and they will be poped by 'run' function just like GUI event loop. >> - PEC doesn't hold any pointer(including weak one) to event until the >> event will be subscribed. > I'm not sure how that's different from react. If an event has no dependents (by which I understand your "subscribed"), react doesn't hold any pointer either. React constructs 'heap' to hold dependency graph inside the library. let e' = map (fun x -> x + 1) e, the e' and e are weakly pointed by the heap. PEC doesn't have heap structure in the library. This is a difference. This difference is important if you want to translate the OCaml event combinator to javascript because javascript doesn't have weak pointer. >> - All PEC's signal are switchable. 'switch' means you can replace dependency >> of a signal keeping signals depends on the signal unchanged. > How is that different from react's E.switch/S.switch ? Almost same except all signals are created though react's S.switch at initializing. It's convenient to design library for dynamic event driven systems. For example, let me assume a signal of window size property. type window = { size : (int * int) signal; } If you want to change the dependency of window.size after initialize the window keeping signals depends on the size unchanged, there is no way except making switch event at initializing. type window = { size : (int * int) signal; size_switch_event : (int * int) event event; } I feel it's not convenient. So I decided to embedded the swith_event to inside of signals. Regards, Ogasawara