Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Accessing constructors (tags) from C
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-11-23 (18:22)
From: Raj Bandyopadhyay <rajb@r...>
Subject: Accessing constructors (tags) from C
Hi all

I was wondering how to access constructors from C. For example if I 
define a type

type t = Null | Int of int

and I want to create values of type t in C using the OCaml-C interface, 
how do I find
the integers corresponding to constructors Null or Int? I would like to 
do this for a large OCaml program with lots of different types etc.