Hi
Le 22 août 07 à 21:16, Ashish Agarwal a écrit :
> What are the rules for variable scope in sub-structures? I would
> like to
> write:
>
> ------ A.ml -------
> type t = string
> let foo = 3
>
> module M = struct
> type t = t list (* this gives recursive type def error, I want
> t in "t
> list" to refer to above t *)
> let foo = foo + 3 (* get error, unrecognized identifier foo *)
--> are you sure for this 2nd error ? I can't reproduce it
Only the first one is a pb, solved by Martin's solution.
So this should not be a pb :
Le 22 août 07 à 22:24, Ashish Agarwal a écrit :
> That's unfortunate. The point of my sub-structure is that it
> specializes the
> previous functions, so giving them the same name is really what I
> need. I
> can rearrange some other way I guess.
The functions can remain the same.
BTW if you're trying to do inheritance with modules you should soon
see that this can be a real mess...
--
Vincent Aravantinos
PhD Student - LIG - CAPP Team
.