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.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 434E2BC0A for ; Fri, 15 Jun 2007 14:41:30 +0200 (CEST) Received: from mail.rsise.anu.edu.au (mail.rsise.anu.edu.au [150.203.208.4]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l5FCfQex000578 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 15 Jun 2007 14:41:29 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.rsise.anu.edu.au (Postfix) with ESMTP id B914353CE7 for ; Fri, 15 Jun 2007 22:41:20 +1000 (EST) Received: from mail.rsise.anu.edu.au ([150.203.208.4]) by localhost (mail [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 18076-08 for ; Fri, 15 Jun 2007 22:41:20 +1000 (EST) Received: from pulp.rsise.anu.edu.au (pulp.rsise.anu.edu.au [150.203.208.49]) by mail.rsise.anu.edu.au (Postfix) with ESMTP id 96FBC53CD1 for ; Fri, 15 Jun 2007 22:41:19 +1000 (EST) Received: by pulp.rsise.anu.edu.au (Postfix, from userid 1560) id DF331A0FFCB; Fri, 15 Jun 2007 22:41:19 +1000 (EST) Date: Fri, 15 Jun 2007 22:41:19 +1000 From: Pietro Abate To: ocaml ml Subject: type_declaration in env.ml Message-ID: <20070615124119.GD20124@pulp.rsise.anu.edu.au> Mail-Followup-To: Pietro Abate , ocaml ml MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: GNU/Linux X-Organization: Research School of Information Science and Engineering (Australian National University) User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at mail.rsise.anu.edu.au X-Miltered: at discorde with ID 467288F6.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 params:01 expr:01 arity:01 expr:01 bool:01 bool:01 mutable:01 params:01 arity:01 desc:01 tvar:01 desc:01 tvar:01 blog:98 hi all, I'm trying to understand this data structure in env.ml in the ocaml src files. type type_declaration = { type_params: type_expr list; type_arity: int; type_kind: type_kind; type_manifest: type_expr option; type_variance: (bool * bool * bool) list } and type_kind = Type_abstract | Type_variant of (string * type_expr list) list * private_flag | Type_record of (string * mutable_flag * type_expr) list * record_representation * private_flag If I've a type like : type t = A of int | B of float I'll get type_params = [] type_arity = 0 type_kind = Type_variant ( [ "A", [ { desc = Tvar ; level = ?? ; id = ?? }] ; "B", [ { desc = Tvar ; level = ?? ; id = ?? }] ] , false ) type_manifest = ?? type_variance = [] correct ? what if I have just type t = int ? where I store the type identifier "t" in both cases ? Can anybody explain me the semantic of these fields ? I can guess some, but I'm not very confident... thanks. pietro -- ++ Blog: http://blog.rsise.anu.edu.au/?q=pietro ++ ++ "All great truths begin as blasphemies." -George Bernard Shaw ++ Please avoid sending me Word or PowerPoint attachments. See http://www.fsf.org/philosophy/no-word-attachments.html