caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe Filliatre <Jean-Christophe.Filliatre@lri.fr>
To: David Fox <dsfox@cogsci.ucsd.edu>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Quick question - accessing variant value from C
Date: Thu, 29 Mar 2001 09:54:02 +0200 (MEST)	[thread overview]
Message-ID: <15042.59930.557493.133492@pc803> (raw)
In-Reply-To: <luelvh6s7a.fsf@hci.ucsd.edu>


Hi,

You can use the macros Is_long / Is_block to discriminate between Null
and Address, since the first one  is represented as an integer and the
second one  as a  structured block  (in the later  case, you  can then
access the string with the Field macro).

Hope this helps,
-- 
Jean-Christophe FILLIATRE
  mailto:Jean-Christophe.Filliatre@lri.fr
  http://www.lri.fr/~filliatr

David Fox writes:
 > I have a value of the following type being passed to an external:
 > 
 >   type pointer = Null | Address of string
 > 
 > and I'd like to determine (in the C code) which variant the value is
 > and get the pointer to the string.  I've stared at mlvalues.h for a
 > while, but I can't really figure it out.  Can anyone help?  You won't
 > regret it...
 > -------------------
 > To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


  reply	other threads:[~2001-03-29  7:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-29  5:48 David Fox
2001-03-29  7:54 ` Jean-Christophe Filliatre [this message]
2001-03-29  8:36   ` Sven LUTHER

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=15042.59930.557493.133492@pc803 \
    --to=jean-christophe.filliatre@lri.fr \
    --cc=caml-list@inria.fr \
    --cc=dsfox@cogsci.ucsd.edu \
    /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).