From: Philippe Veber <philippe.veber@gmail.com>
To: "Daniel Bünzli" <daniel.buenzli@erratique.ch>
Cc: caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] Functional GUI programming: looking for good practices
Date: Tue, 14 Feb 2012 11:39:02 +0100 [thread overview]
Message-ID: <CAOOOohRYM3j2osi9mJKmosL+-BgwgLV-V7vUfR7iRMdNeHnj8g@mail.gmail.com> (raw)
In-Reply-To: <4EE9238E9F474D96925E5920255FD691@erratique.ch>
[-- Attachment #1: Type: text/plain, Size: 1087 bytes --]
Hi Daniel,
2012/2/14 Daniel Bünzli <daniel.buenzli@erratique.ch>
> Le mardi, 14 février 2012 à 11:02, Philippe Veber a écrit :
>
> > In other words, am I allowed to call a primitive in a lifted function?
> No. This is documented here [1].
Well I did read the paragraph, but thought the described limitation might
be about updating a signal from different threads. Of course it makes sense
that even in a single-threaded code, an update cycle should not be
interrupted by another if there are shared dependencies. May I nevertheless
humbly suggest to add the "not calling a primitive inside a lifted
function" rule more explicitely, as it is a tempting sin for a beginner?
> One way to side-step the issue is to put these updates in a queue and
> execute them after the update cycle ended.
>
That seems a good work-around, to gather all side-effects in one place,
namely a (unit -> unit) Queue.t where to defer all calls to the primitives.
That do help, thanks !
ph.
> Best,
>
> Daniel
>
> [1] http://erratique.ch/software/react/doc/React#update
>
[-- Attachment #2: Type: text/html, Size: 1760 bytes --]
next prev parent reply other threads:[~2012-02-14 10:39 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-13 11:01 Philippe Veber
2012-02-13 15:27 ` Adrien
2012-02-14 10:02 ` Philippe Veber
2012-02-14 10:21 ` Daniel Bünzli
2012-02-14 10:39 ` Philippe Veber [this message]
2012-02-14 11:52 ` Adrien
2012-02-14 13:00 ` Daniel Bünzli
2012-02-14 13:29 ` Adrien
2012-02-13 18:13 ` Raoul Duke
2012-02-14 0:36 ` Anthony Tavener
2012-02-14 10:17 ` Philippe Veber
2012-02-14 18:02 ` Anthony Tavener
2012-02-15 4:47 ` Anthony Tavener
2012-02-22 11:57 ` Philippe Veber
2012-02-28 10:10 ` Adrien
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAOOOohRYM3j2osi9mJKmosL+-BgwgLV-V7vUfR7iRMdNeHnj8g@mail.gmail.com \
--to=philippe.veber@gmail.com \
--cc=caml-list@inria.fr \
--cc=daniel.buenzli@erratique.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox