caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Mathias Kende <mathias@kende.fr>
To: caml-list@yquem.inria.fr
Subject: RE: [Caml-list] Accessing constructors (tags) from C
Date: Sun, 23 Nov 2008 22:49:20 +0100	[thread overview]
Message-ID: <1227476960.6807.3.camel@MATHIAS-ENS> (raw)
In-Reply-To: <005c01c94d9b$2fbec1b0$8f3c4510$@com>

Le dimanche 23 novembre 2008 à 18:42 +0000, David Allsopp a écrit :
> See Section 18.3.4 of the manual. In your example below, Null is an
> integer
> 0 and Int is a 1-word block with tag 1. In C, Null is Val_int(0) and t
> =
> Int(x) is caml_alloc(1, 1); Store_field(t, 0, Val_int(x)).

(Int x) is t = caml_alloc(1,0); Store_field(t,0,Val_int(x)). Because the
numbering of the fields starts from zero separately for the constant and
non-constant constructors (definitely, this is error prone).

Mathias


      reply	other threads:[~2008-11-23 21:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-23 18:22 Raj Bandyopadhyay
2008-11-23 18:38 ` [Caml-list] " Eric Cooper
2008-11-23 18:42 ` David Allsopp
2008-11-23 21:49   ` Mathias Kende [this message]

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=1227476960.6807.3.camel@MATHIAS-ENS \
    --to=mathias@kende.fr \
    --cc=caml-list@yquem.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).