From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA31244; Wed, 30 May 2001 18:50:17 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA31168 for ; Wed, 30 May 2001 18:50:16 +0200 (MET DST) Received: from shell5.ba.best.com (shell5.ba.best.com [206.184.139.136]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f4UGoEv06148; Wed, 30 May 2001 18:50:15 +0200 (MET DST) Received: from localhost (bpr@localhost) by shell5.ba.best.com (8.9.3/8.9.2/best.sh) with ESMTP id JAA04165; Wed, 30 May 2001 09:50:13 -0700 (PDT) Date: Wed, 30 May 2001 09:50:13 -0700 (PDT) From: Brian Rogoff To: Luc Maranget cc: John Max Skaller , caml-list@inria.fr Subject: Re: [Caml-list] ocaml and named constants In-Reply-To: <200105291350.PAA0000018491@beaune.inria.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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