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.3 required=5.0 tests=AWL autolearn=disabled version=3.1.3 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 9A308BB84 for ; Fri, 12 Sep 2008 16:37:57 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhcBAOMbykiBaB4io2dsb2JhbACSZwEBAQEBAQcFCAcRpSeBYg X-IronPort-AV: E=Sophos;i="4.32,389,1217800800"; d="scan'208";a="14879355" Received: from mx1.polytechnique.org ([129.104.30.34]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 12 Sep 2008 16:37:57 +0200 Received: from is005115 (is005115.intra.cea.fr [132.166.135.75]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ssl.polytechnique.org (Postfix) with ESMTP id 5989B33172 for ; Fri, 12 Sep 2008 16:37:56 +0200 (CEST) Date: Fri, 12 Sep 2008 16:37:55 +0200 From: Virgile Prevosto To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Private type syntax and error message Message-ID: <20080912163755.4b1f0201@is005115> In-Reply-To: <78095.20041.qm@web54605.mail.re2.yahoo.com> References: <200809121604.56179.jon@ffconsultancy.com> <78095.20041.qm@web54605.mail.re2.yahoo.com> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.9; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-AV-Checked: ClamAV using ClamSMTP at djali.polytechnique.org (Fri Sep 12 16:37:56 2008 +0200 (CEST)) X-Org-Mail: virgile.prevosto.1996@polytechnique.org X-Spam: no; 0.00; syntax:01 cvs:01 syntax:01 foo:01 int':01 int':01 iirc:01 ocaml:01 cvs:01 ocaml:01 tutto:98 oggi:98 volta:98 caml-list:01 int:01 Hello, Le ven 12 sep 2008 07:19:54 CEST, Dario Teixeira a =C3=A9crit : >=20 > Btw, the code works on 3.11 CVS! >=20 Yes, this is a feature scheduled to be added in 3.11. in 3.10.x, only variant and records can be made private.=20 Le ven 12 sep 2008 15:43:19 CEST, Colonna Francois a =C3=A9crit : > # type my_int =3D private int;; >=20 > I get the message : "This fixed type is not an object or variant" >=20 > 1. The message is very obscure > 2. why this syntax is not implemented as it should be ? The syntax seems to be implemented as what the documentation says. See http://caml.inria.fr/pub/docs/manual-ocaml/manual021.html#htoc99:=20 "Private types type-representation ::=3D ... =20 =E2=88=A3 =3D private constr-decl { | constr-decl } =20 =E2=88=A3 =3D private { field-decl { ; field-decl } } " i.e. at the moment you can write 'type foo =3D private A of int' or 'type bar =3D private { a of int }' but not directly 'type my_int =3D private int' (IIRC, there are some technical reasons linked to the internal representation of ocaml syntax tree for that)=20 As said above, you have to wait (or try the cvs version) for ocaml 3.11 to be able to declare any type definition as private. --=20 E tutto per oggi, a la prossima volta. Virgile