From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 7500EBBAF for ; Mon, 31 May 2010 17:43:49 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Am0CAJZ2A0zRVdQ2kGdsb2JhbACDGI5ljC4IFQEBAQEJCQwHEQMfsA6CO4UQiH0BAQMFgSGDBWsEjXM X-IronPort-AV: E=Sophos;i="4.53,334,1272837600"; d="scan'208";a="52142849" Received: from mail-vw0-f54.google.com ([209.85.212.54]) by mail2-smtp-roc.national.inria.fr with ESMTP; 31 May 2010 17:43:44 +0200 Received: by vws10 with SMTP id 10so1597933vws.27 for ; Mon, 31 May 2010 08:43:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=r45E6kHPfIbuk1WLvz8IaiD3s7YSUgnw90OoWJd4dBA=; b=u/CdWDr3IxrkV36v2HcklhofV+xENG869SWHDHlutj0s09qR8oc6q2kwmNJXiPcuhz j2QYOCF/f7rIbXQX0eif4IbRBgvdyILCcleo+141wP73rMfRY4XE3YAfFsxe83eS+1g0 chf0qLCjH+YM/29GQLO9xLA+8jUbWU0O2puCk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=HYMLLlT4N5KNjCUNrKP6FiCqFF5o8CojVRGD5ek9aYim5sozG5cZnZVy4iBjES0aLD rBuVAD6JJkl5d9GRPdHwjKXYk5MOSTxo2SRDHIEKD9n2xZJ819ec+TOFrPkyYNRro2ho J/Ua0y8Dt7yW4roQABPs/LWGdMpnoM1q32OeE= MIME-Version: 1.0 Received: by 10.224.113.217 with SMTP id b25mr1747207qaq.345.1275320623658; Mon, 31 May 2010 08:43:43 -0700 (PDT) Sender: till.varoquaux@gmail.com Received: by 10.229.99.143 with HTTP; Mon, 31 May 2010 08:43:43 -0700 (PDT) In-Reply-To: <4C03CBD3.3010606@mcmaster.ca> References: <4C03CBD3.3010606@mcmaster.ca> Date: Mon, 31 May 2010 11:43:43 -0400 X-Google-Sender-Auth: T9-qDhL8TKfPBJrLpmI4YWhQntg Message-ID: Subject: Re: [Caml-list] Why is this allowed? From: Till Varoquaux To: Jacques Carette Cc: caml-list@inria.fr Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; afaik:01 foo:01 struct:01 foo:01 struct:01 metaocaml:01 beginner's:01 ocaml:01 bug:01 beginners:01 wrote:01 pps:01 caml-list:01 caml-list:01 jussieu:01 AFAIK you are allowed to shadow just about anything in implementations. If you wanted to keep the exact same interface but retain the ability to avvoid the shadowing issue on the labels you could do: module Foo =3D struct type t =3D Foo end type foo =3D Foo.t =3D Foo module Foo2 =3D struct type t =3D Foo | Bar end type foo2 =3D Foo2.t =3D Foo | Bar HTH, Till On Mon, May 31, 2010 at 10:46 AM, Jacques Carette wro= te: > type foo =3D Foo > let x =3D Foo > > type foo2 =3D Foo | Bar > let y =3D Foo > let z =3D (x,y) ;; > > I thought that re-using of algebraic labels was not allowed - but apparen= tly > it is? =C2=A0Note that this means that it is impossible to "text" print s= uch > structures and hope to recover them uniquely. =C2=A0This also causes very= subtle > issues when Marshal'ing, and grave issues for code generation [think > metaocaml]. > > Jacques > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >