From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: oleg@okmij.org
Cc: gabriel.scherer@gmail.com, goswin-v-b@web.de, caml-list@inria.fr
Subject: Re: [Caml-list] Why List.map does not be implemented
Date: Wed, 01 Oct 2014 14:00:27 +0200 [thread overview]
Message-ID: <1412164827.5797.143.camel@e130> (raw)
In-Reply-To: <20141001102943.AA0C0C382A@www1.g3.pair.com>
[-- Attachment #1: Type: text/plain, Size: 1741 bytes --]
Am Mittwoch, den 01.10.2014, 06:29 -0400 schrieb oleg@okmij.org:
> To understand the problem, let us recall the main principle stated
> earlier: ``There are two ways the function call (flip 0.5)
> can return: it can return with true or with false.'' That is, the
> function call (flip 0.5) returns *twice*. Therefore, the call (f h)
> in the let cell statement returns twice. Therefore, the assignment
> dst.tl <- Obj.magic cell;
> will be executed twice. And the second execution of that assignment
> will be with a different cell, which will override and destroy the
> result of the first assignment. That is how the "true" choices became
> lost.
IMHO this is irrelevant for the normal OCaml evaluation regime. The
standard interpretation of a type 'a -> 'b is that it returns only once.
There is no alternate local world. I don't know what Hansei is doing to
get this effect, but it looks like it uses continuations, STM, or some
other technique to checkpoint some state and restart from there. This
technique is obviously not taking local state into account (which would
also have to be duplicated), but this is a limitation of this technique.
I don't think this is a valid argument against using hidden local state.
It's more an argument that if you use such checkpointing techniques, you
need to be extremely careful.
Gerd
>
>
>
--
------------------------------------------------------------
Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de
My OCaml site: http://www.camlcity.org
Contact details: http://www.camlcity.org/contact.html
Company homepage: http://www.gerd-stolpmann.de
------------------------------------------------------------
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2014-10-01 12:00 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-28 19:31 [Caml-list] Why List.map does not be implemented tail-recursively? Shuai Wang
2014-09-28 19:36 ` Gabriel Scherer
2014-09-28 19:45 ` Anthony Tavener
2014-09-29 12:08 ` Goswin von Brederlow
2014-09-29 14:02 ` Pierre Chambart
2014-09-29 15:44 ` Yaron Minsky
2014-09-29 21:00 ` Gabriel Scherer
2014-09-30 8:46 ` [Caml-list] Why List.map does not be implemented oleg
2014-09-30 9:07 ` Gabriel Scherer
2014-10-01 10:29 ` oleg
2014-10-01 12:00 ` Gerd Stolpmann [this message]
2014-10-29 10:11 ` Gabriel Scherer
2014-10-02 10:09 ` [Caml-list] Why List.map does not be implemented tail-recursively? Stephen Dolan
2015-06-01 12:02 ` Jon Harrop
2015-06-02 12:04 ` Stephen Dolan
2015-06-05 10:21 ` Goswin von Brederlow
2014-09-30 6:29 ` Goswin von Brederlow
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=1412164827.5797.143.camel@e130 \
--to=info@gerd-stolpmann.de \
--cc=caml-list@inria.fr \
--cc=gabriel.scherer@gmail.com \
--cc=goswin-v-b@web.de \
--cc=oleg@okmij.org \
/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