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 (14:47)
From: Jacques Carette <carette@m...>
Subject: Why is this allowed?
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?  Note that this means that it is impossible to "text" 
print such structures and hope to recover them uniquely.  This also 
causes very subtle issues when Marshal'ing, and grave issues for code 
generation [think metaocaml].