Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: [Caml-list] ocaml and named constants
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: David Fox <dsf@f...>
Subject: Re: [Caml-list] ocaml and named constants
Brian Rogoff <bpr@best.com> writes:

> On Thu, 31 May 2001, Luc Maranget wrote:
> > But I have another remark
> > as far a ``manifest constants'' are the issue, Polymorphic
> > variants
> > (http://caml.inria.fr/ocaml/htmlman/manual003.html)
> > seem to do the job.
> > 
> > After all, provided you do not care much about the actual value of Foo)
> 
> Ah, the problem for me is that I really do care about the actual value for 
> the constants. It turns out that I may process binary file formats (GDSII
> is the canonical example) where I want the name to correspond to a number. 

I too run into a lot of situations where I care about the actual value
for my constants because of the various exteral C libraries I use.
However, I am satisfied with the "x when x = a -> ..."  solution if it
gives the same optimization that "3 -> ..." would.
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr