From: Dmitry Bely <dbely@mail.ru>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Bigarray question
Date: Mon, 28 Nov 2005 12:39:43 +0300 [thread overview]
Message-ID: <ek51w1pc.fsf@mail.ru> (raw)
In-Reply-To: <Pine.LNX.4.61.0511272345210.3795@eiger.cip.physik.uni-muenchen.de> (Thomas Fischbacher's message of "Sun, 27 Nov 2005 23:48:15 +0100 (CET)")
Thomas Fischbacher <Thomas.Fischbacher@Physik.Uni-Muenchen.DE> writes:
>> > As far as I can see from the documentation, it is not explicitly permitted
>> > to change a once allocated bigarray data structure in such a way that one
>> > replaces the data pointer by some other data pointer (while retaining
>> > size and type). This would, however, be quite useful in some situations.
>>
>> Is your bigarray a wrapper around some externally allocated data, created
>> via alloc_bigarray() C call?
>
> It's a somewhat special case of just that situation, yes.
>
> I supposed I may just do so, however, the specification (documentation)
> does not give me any guarantee that this is valid, so, at least the
> documentation has to be changed before I can rely on this.
1. For the current implementation it's safe (use Data_bigarray_val(v) to
change the data pointer). I don't see any reason why it could become unsafe.
2. It is up to you whether to use this feature or not.
> There is a subtle difference between "just accidentally works"
> and "works because it is guaranteed by specification".
OCaml is a developing language, so IMHO nobody guarantees that nothing will
change in the future.
- Dmitry Bely
next prev parent reply other threads:[~2005-11-28 10:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-25 18:19 Thomas Fischbacher
2005-11-25 20:06 ` [Caml-list] " Dmitry Bely
2005-11-27 22:48 ` Thomas Fischbacher
2005-11-28 9:39 ` Dmitry Bely [this message]
2005-11-28 21:30 ` Thomas Fischbacher
2007-12-18 17:44 Thomas Fischbacher
2007-12-19 17:47 ` [Caml-list] " Xavier Leroy
2007-12-19 19:15 ` Thomas Fischbacher
2008-01-28 12:57 ` Thomas Fischbacher
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=ek51w1pc.fsf@mail.ru \
--to=dbely@mail.ru \
--cc=caml-list@inria.fr \
/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