caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Goswin von Brederlow <goswin-v-b@web.de>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Expanding the Float Array tag
Date: Thu, 19 Sep 2013 11:47:17 +0200	[thread overview]
Message-ID: <20130919094717.GD25801@frosties> (raw)
In-Reply-To: <20130919061838.17829.qmail@www1.g3.pair.com>

On Thu, Sep 19, 2013 at 06:18:38AM -0000, oleg@okmij.org wrote:
> 
> I am curious about the focus on generalizing double_tag or
> double_array_tag when there is already a seemingly good candidate for
> tagging values that should not be scanned. I mean the
> string_tag. Please search the OCaml code for string_tag and
> String_tag. You see it is mentioned in generic routines like
> generic comparison compare.c -- which uses memcpy anyway, thus
> treating the string just like a sequence of bytes. Other generic
> functions like hash are similar. The only other non-trivial use of
> string_tag is in printexc and the likes. Those cases are indeed
> problematic. Other than them, string_tag can denote arbitrary opaque
> byte array and noone will notice. Incidentally, if by string we mean
> UTF-8 or UTF-16 string, it is essentially a sequence of bytes anyway.

Strings are special in that they have a length in bytes. The length in
words is taken from the header, multiplied by the word size and the
delta to the real string length is stored in the last byte of the block.

Reusing the string tag would confuse code that relies on this, like
marshaling.

MfG
	Goswin

  reply	other threads:[~2013-09-19  9:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-16 15:26 Yotam Barnoy
2013-09-16 16:29 ` Markus Mottl
2013-09-16 16:49   ` Yotam Barnoy
2013-09-16 17:14     ` Markus Mottl
2013-09-16 19:09       ` Yotam Barnoy
2013-09-17  0:31         ` Yotam Barnoy
2013-09-19  9:40     ` Goswin von Brederlow
2013-09-17  9:32 ` Gerd Stolpmann
2013-09-18 15:10   ` Yotam Barnoy
2013-09-19  6:18     ` oleg
2013-09-19  9:47       ` Goswin von Brederlow [this message]
2013-09-19 10:10     ` Goswin von Brederlow
2013-09-20  2:18       ` Yotam Barnoy
2013-09-20  6:25         ` 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=20130919094717.GD25801@frosties \
    --to=goswin-v-b@web.de \
    --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;
as well as URLs for NNTP newsgroup(s).