Le mercredi, 18 avril 2012 à 13:44, Satoshi Ogasawara a écrit : > But PEC dose not violate good semantics either. PEC treats only one event at > any > given time t. Please see blow code.
I don't think your code shows the problem I'm talking about. > module E = Pec.Event.Make (Pec.EventQueue.DefaultQueueM) > (Pec.EventQueue.DefaultQueueI) > open Printf > > let _ = > let e, sender = E.make () in > let e' = E.map (fun x -> sender 2; x + 1) e in (* during update cycle, send > 2. *) Here add : let e'' = E.map (fun x -> sender 3; x + 1) e in and now what should the value of e be in the next update cycle ? All the options you have (keep only the first call to sender, keep only the last call to sender, keep both and execute one after the other) break the functional and compositional nature of FRP because it violates the semantics of events. > To write event driven systems such like GUI sometimes needs a event-event > chain > without real-user actions. Sending events during update cycle is something > unavoidable. I don't have enough experience to assert that's really the case. However if that's needed I suspect that the way to resolve conflicts that break the semantics, should they arise, is actually very specific to the problem domain and shouldn't rely on anything related to the order of updates during the update cycle. The only thing I'm saying here is that your first message made it sound like PEC solved a problem of React ("You can send a value to event during update cycle."). It's not a problem of React it's a problem of interfacing FRP with your application domain. And React can perfectly be adapted to use the same unsound solution that PEC seems to use by adding the sender calls in a thunk queue and dequeing after the end of the update cycle. > Yes, weak-pointer-less implementation is one of my purpose. The key point is > that dependency of events are represented by nested variants. That doesn't really answer my question (or at least I don't understand what it means). Best, Daniel -- Caml-list mailing list. Subscription management and archives: https://sympa-roc.inria.fr/wws/info/caml-list Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs