Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Managing a polymorphic environment
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Diego Olivier Fernandez Pons <Diego.FERNANDEZ_PONS@e...>
Subject: Re: [Caml-list] Managing a polymorphic environment
    Bonjour,

Diego Olivier Fernandez Pons wrote :

> The problem is to make Env forget it is typed because the
> polymorphic parameter 'a captures the first instanciated type (int
> in my example) even if (==) is polymorphic.

The first problem is that it doesn't work. (==) reduces to (=) for
simple types

let x = 5
let y = 5
let env = Env.add x "x" env
let env = Env.add y "y" env

# Env.get_string x env ;;
- : string = "y"


        Diego Olivier

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners