English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Why is this allowed?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-05-31 (15:06)
From: Lukasz Stafiniak <lukstafi@g...>
Subject: Re: [Caml-list] Why is this allowed?
But what when someone includes or opens a module with Foo after "type
foo = Foo"? What when someone opens it locally in an expression?

Does a variant value have a unique type with a unique path so that it
would be possible to guarantee that within this unique path there are
no type *definitions* that override a variant name?

On Mon, May 31, 2010 at 4:46 PM, Jacques Carette <carette@mcmaster.ca> wrote:
> type foo = Foo
> let x = Foo
> type foo2 = Foo | Bar
> let y = Foo
> let z = (x,y) ;;
> I thought that re-using of algebraic labels was not allowed - but apparently
> it is?