From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 2CB7A7EE5C for ; Tue, 13 May 2014 18:07:39 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of jdimino@janestreet.com) identity=pra; client-ip=38.105.200.112; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="jdimino@janestreet.com"; x-sender="jdimino@janestreet.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of jdimino@janestreet.com designates 38.105.200.112 as permitted sender) identity=mailfrom; client-ip=38.105.200.112; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="jdimino@janestreet.com"; x-sender="jdimino@janestreet.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mxout1.mail.janestreet.com) identity=helo; client-ip=38.105.200.112; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="jdimino@janestreet.com"; x-sender="postmaster@mxout1.mail.janestreet.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao0BAL1CclMmachwnGdsb2JhbABZg1VYgmerK45riH0BgRoIFg4BAQEBAQYWCTyCJQEBBAEjHQEBLAsBBAsLBAcaHQICIQESAQUBChIGExKIGwMJCAMCCKABixp3g14BBZoBAwqGVBEGjDuCEwQHgnWBS4ReBJJ4gXKBPItjg3cYKYRn X-IPAS-Result: Ao0BAL1CclMmachwnGdsb2JhbABZg1VYgmerK45riH0BgRoIFg4BAQEBAQYWCTyCJQEBBAEjHQEBLAsBBAsLBAcaHQICIQESAQUBChIGExKIGwMJCAMCCKABixp3g14BBZoBAwqGVBEGjDuCEwQHgnWBS4ReBJJ4gXKBPItjg3cYKYRn X-IronPort-AV: E=Sophos;i="4.97,1044,1389740400"; d="scan'208";a="61694468" Received: from mxout1.mail.janestreet.com ([38.105.200.112]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 13 May 2014 18:07:37 +0200 Received: from tot-smtp.delacy.com ([172.27.22.15] helo=tot-smtp) by mxout1.mail.janestreet.com with esmtps (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1WkFEt-0002QD-1a for caml-list@inria.fr; Tue, 13 May 2014 12:07:35 -0400 Received: from tot-dmz-mxgoog1.delacy.com ([172.27.224.14] helo=mxgoog2.janestreet.com) by tot-smtp with esmtps (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WkFEs-0005tp-V1 for caml-list@inria.fr; Tue, 13 May 2014 12:07:34 -0400 Received: from mail-ie0-f174.google.com ([209.85.223.174]) by mxgoog2.janestreet.com with esmtp (Exim 4.76) (envelope-from ) id 1WkFEs-0006GC-Ss for caml-list@inria.fr; Tue, 13 May 2014 12:07:34 -0400 Received: by mail-ie0-f174.google.com with SMTP id at1so533646iec.19 for ; Tue, 13 May 2014 09:07:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=/MuCvxO0C7QIr7pLBgVwuGS0f3PBBnWfA8yZM9c763M=; b=fwLrcNxO6Z3qXr6qEgjK9tBEUvelv76EnccuDNNNCPo+r1WxDfrGZewwtxpIwPTbH2 qCzLFfsZburkCsQrAlcroXGx1ke0u6rmJgueZKd+FmE7rlRvEMsi+m27HCq8G+MyOTte 0hqBrItZjliOyr35g+XpiPsYKHabGQbiN/m8w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=/MuCvxO0C7QIr7pLBgVwuGS0f3PBBnWfA8yZM9c763M=; b=eX0zHFHqY4OPXLKj7+1wmkp8Wu/Dhx21UmFqRD8IQlpjLLGHECIxkPh5hoT62HvoIQ QAuzCWJsBv6LhYVARIAroClS5eUDlgoEGqfLFU38JoN8a34d+vCDJMGf9iT4tw+SKlxd B/j67Bd4PwnltYWQak+IuB3NdhmO+2JsmX3VC/Z3EyqzwJs6rq8qxmBr8bcWIWeMmogu 1kedHXtXurSyKjw0QFy4cC2ntsH01DuBAzDJjegA9mN7b5NnDiQNuvYaSZJxNRyjOjEQ aWDZwh7fOXkRPaGKpX+7O/FbIMh5Pi/sGRo5OFsEniuRrlsrF6dBiAtOiQPPViMaXtKA s+nQ== X-Gm-Message-State: ALoCoQkDmtdXnEgzXI45WabTSJ3mMuHnNRi7p7fhTvQbdcEmAxXhnufR7oB0M/H8IPS2lUCCM8fOWoWliu+uhn4F4XqfnxwNb71YLXgZ+TCZCzpB2JvXB5tl9sNv7FbMk1o+wfzDPqiT X-Received: by 10.50.79.227 with SMTP id m3mr55940418igx.47.1399997254645; Tue, 13 May 2014 09:07:34 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.50.79.227 with SMTP id m3mr55940404igx.47.1399997254553; Tue, 13 May 2014 09:07:34 -0700 (PDT) Received: by 10.50.117.40 with HTTP; Tue, 13 May 2014 09:07:34 -0700 (PDT) In-Reply-To: References: Date: Tue, 13 May 2014 17:07:34 +0100 Message-ID: From: Jeremie Dimino To: =?UTF-8?Q?Milan_Stanojevi=C4=87?= Cc: Caml List Content-Type: multipart/alternative; boundary=089e01175f5d0b699404f94a43a6 Subject: Re: [Caml-list] open extensible types representation --089e01175f5d0b699404f94a43a6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable For a constructor argument it is a constructed value of size 2 and tag [Obj.object_tag]: - the first field of this value is a string, it is the name of the constructor - the second field is a unique integer identifier For a constructor with [n] arguments, it is of value of size [n+1]. The first field points to the same 2-fields constructed value described above and the other fields are the arguments. The reason the tag of the constructor "bucket" is [Obj.object_tag] is so that the generic [Pervasives.compare] compares only the integer identifiers in the second fields. On Tue, May 13, 2014 at 4:53 PM, Milan Stanojevi=C4=87 = wrote: > 4.02 will have extensible data types. > > What is the runtime representation of an extensible data type? > > Thanks! > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > --=20 Jeremie --089e01175f5d0b699404f94a43a6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
For a constructor argument it is a constructed value of si= ze 2 and tag [Obj.object_tag]:
- the first field of this value is a str= ing, it is the name of the constructor
- the second field is = a unique integer identifier

For a constructor with [n] arguments, it is of value of= size [n+1]. The first field points to the same 2-fields constructed value = described above and the other fields are the arguments.

The reason the tag of the constructor "bucket" is [Obj.objec= t_tag] is so that the generic [Pervasives.compare] compares only the intege= r identifiers in the second fields.


On Tue, May 13, 2014 at 4:53 PM, Milan S= tanojevi=C4=87 <milanst@gmail.com> wrote:
4.02 will have extensible data types.

What is the runtime representation of an extensible data type?

Thanks!

--
Caml-list mailing list. =C2=A0Subscription management and archives:
ht= tps://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs



-- Jeremie
--089e01175f5d0b699404f94a43a6--