Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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].