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
[Caml-list] unexpected functor behavior in 3.08.1 compiler
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-09-27 (22:32)
From: Shaddin Doghmi <shaddin@m...>
Subject: [Caml-list] unexpected functor behavior in 3.08.1 compiler
I am experiencing unexpected functor behaviour using the 3.08.1 compiler 
(both ocamlc and ocamlopt). The 3.07+2 compiler works great and does not 
have this problem. I am wondering if it is a known bug, despite the fact 
that i was not able to replicate this behaviour with a small example(it 
only happens in a large project im working on, and only in 3.08.1).

In a functor:

module A(B:Bsig) = struct
module B =B
open B

let y = name


when i make two instances of functor A using two different input modules 
B1 and B2


i sometimes find that A2.y refers to as opposed to , 
while A2.x correctly refers to . Hence, it seems that using the 
open statement when creating A2 is "opening" B1 as opposed to B2 .....
for some reason i wasnt able to replicate this behaviour in a small 
example, so i dont know under exactly what circumstances this happens....
has anybody else seen this kind of behaviour before? does it have 
anything to do with how open is defined inside functors?

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: