Re: Non generalizable type of constants?

From: Thorsten Ohl (ohl@hep.tu-darmstadt.de)
Date: Mon Feb 15 1999 - 19:04:51 MET


From: Thorsten Ohl <ohl@hep.tu-darmstadt.de>
Date: Mon, 15 Feb 1999 19:04:51 +0100 (CET)
To: caml-list@inria.fr
Subject: Re: Non generalizable type of constants?
In-Reply-To: <199902151745.SAA19162@pauillac.inria.fr>
 <199902151745.SAA19162@pauillac.inria.fr>

Pierre Weis <Pierre.Weis@inria.fr> writes:

> If you insist at abstracting the type Groupe.t,

I do, because this way I can hide details of different groups from
free constructions over them ...

> I'm not aware of any solution to your problem, except turning your
> unit_bad identifier into a function let unit_bad () = A.atom (M.unit).

Syntactically, It's not pretty, but I can live with it. I shied away
from this because I was not sure about the result of

  module F = FreeRing ( some ring ...)
  compare (F.unit_bad ()) (F.unit_bad ())

in this case. Does O'Caml guarantee that the expression will always
evaluate to 0? [ Currently it appears to, but can I depend on it? ]

> More generally, what you call constants are computed values, even if
> the computation is simple in your case, hence we have the general
> problem of references.

I had this confused, thanks for pointing it out!
-Thorsten

-- 
Thorsten Ohl, Physics Department, TU Darmstadt -- ohl@hep.tu-darmstadt.de
http://heplix.ikp.physik.tu-darmstadt.de/~ohl/ [<=== PGP public key here]



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:19 MET