From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 7534FBB84 for ; Sun, 23 Nov 2008 19:22:16 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Al8CAFMuKUmAKgEfgWdsb2JhbACPEYRLAQEWIq9nhGOEcIJ8 X-IronPort-AV: E=Sophos;i="4.33,654,1220220000"; d="scan'208";a="20279027" Received: from mail.cs.rice.edu ([128.42.1.31]) by mail1-smtp-roc.national.inria.fr with ESMTP; 23 Nov 2008 19:22:15 +0100 Received: from mail.cs.rice.edu (localhost.localdomain [127.0.0.1]) by mail.cs.rice.edu (Postfix) with ESMTP id 1B8F02C2AD0 for ; Sun, 23 Nov 2008 12:22:15 -0600 (CST) X-Virus-Scanned: by amavis-2.4.0 at mail.cs.rice.edu Received: from mail.cs.rice.edu ([127.0.0.1]) by mail.cs.rice.edu (mail.cs.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id hEEqYivKfZQS for ; Sun, 23 Nov 2008 12:22:07 -0600 (CST) Received: from [192.168.1.65] (adsl-217-53-149.asm.bellsouth.net [68.217.53.149]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.cs.rice.edu (Postfix) with ESMTP id 4A7752C2A8E for ; Sun, 23 Nov 2008 12:22:07 -0600 (CST) Message-ID: <49299F76.6090006@rice.edu> Date: Sun, 23 Nov 2008 13:22:46 -0500 From: Raj Bandyopadhyay User-Agent: Thunderbird 2.0.0.17 (X11/20080925) MIME-Version: 1.0 To: caml-list@yquem.inria.fr Subject: Accessing constructors (tags) from C Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; constructors:01 constructors:01 integers:01 ocaml:01 int:01 int:01 define:02 types:05 null:05 null:05 raj:05 raj:05 interface:06 wondering:09 example:10 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. Thanks! Raj