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: Brian Rogoff <bpr@b...>
Subject: Re: [Caml-list] ocaml and named constants
On Tue, 29 May 2001, Luc Maranget wrote:
> > 
> > 	Is there any semantic reason why
> > one cannot use variables, or even expressions? Apart from
> > the obvious syntactic problem.
> 
> Not that obvious, I think this would make pattern-matching look
> like even more complicated.
> It is good to stress on the fact that
> in match .. with p ->, p is a pattern
>   1. Some value ``whith holes''
>   2. Something we programmer and compiler know without any computation.

I read a paper on an SML extension to handle this named constant problem,
here at ftp://ftp.research.bell-labs.com/dist/smlnj/papers/92-tr-aitken.ps
Anyone know why this or some similar approach hasn't caught on? The CamlP4 
approach isn't too bad, but this seems important enough to be in the core 
language. 

This is certainly on my "wish list" for future enhancements, since there
are so many cases where named constants are useful and the current
workarounds are a bit ugly. 

-- Brian


-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr