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 NAA25351; Wed, 30 May 2001 13:23:09 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA24983 for caml-list@pauillac.inria.fr; Wed, 30 May 2001 13:23:08 +0200 (MET DST) 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 LAA24220 for ; Wed, 30 May 2001 11:46:39 +0200 (MET DST) Received: from wildcat.uni-muenster.de (WI.UNI-MUENSTER.DE [128.176.159.139]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f4U9kdv21524 for ; Wed, 30 May 2001 11:46:39 +0200 (MET DST) Message-Id: <200105300946.f4U9kdv21524@concorde.inria.fr> Received: from wi.uni-muenster.de (POSEIDON [128.176.158.97]) by wildcat.uni-muenster.de with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id K8H4R212; Wed, 30 May 2001 11:46:38 +0200 X-Mailer: exmh version 2.2 06/23/2000 with nmh-1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] ocaml and named constants In-Reply-To: Message from John Max Skaller of "Wed, 30 May 2001 03:16:52 +1000." <3B13D984.A8CAF922@ozemail.com.au> References: <20010528143238.D19801@pauillac.inria.fr> <3B12F66C.5F5793F9@ozemail.com.au> <3B139236.C2B435F0@ps.uni-sb.de> <3B13D984.A8CAF922@ozemail.com.au> Reply-to: wlux@uni-muenster.de Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Date: Wed, 30 May 2001 11:46:37 +0200 From: Wolfgang Lux Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk John Max Skaller wrote > Unless you use a 'when' construct .. which already > provides what I was asking for. The case when this is most > annoying is for 'manifest constants': > = > let c1 =3D 1 > and c2 =3D 2 > in match expr with > | x when x =3D c1 -> .. > | x when x =3D c2 -> .. > Maybe it's time to ask for a little syntax extension, viz. to allow for = multiple when clauses in a pattern matching. (This is similar to what = is allowed e.g. in Haskell already.) Thus the above matching could be = rewritten as: match expr with | x when x =3D c1 -> .. when x =3D c2 -> .. The syntax for pattern matchings would have to be changed as follows: ::=3D ["|"] { "|" } ::=3D "->" | "when" "->" { "when" "->" } And a similar change would apply to . = Wolfgang Lux -- Wolfgang Lux Phone: +49-251-83-38263 Institut fuer Wirtschaftinformatik FAX: +49-251-83-38259 Universitaet Muenster Email: wlux@uni-muenster.de ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr