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 JAA24698; Thu, 24 Oct 2002 09:05:38 +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 JAA24651 for ; Thu, 24 Oct 2002 09:05:38 +0200 (MET DST) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from athlon.baretta.com ([62.211.4.209]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g9O75a515478 for ; Thu, 24 Oct 2002 09:05:37 +0200 (MET DST) Received: from baretta.com (localhost.localdomain [127.0.0.1]) by athlon.baretta.com (Postfix) with ESMTP id BDF5427250 for ; Thu, 24 Oct 2002 09:16:37 +0200 (CEST) Message-ID: <3DB79E55.4080608@baretta.com> Date: Thu, 24 Oct 2002 09:16:37 +0200 From: Alessandro Baretta Organization: Baretta srl -- www.baretta.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826 X-Accept-Language: it, en MIME-Version: 1.0 To: ocaml Subject: Re: [Caml-list] Again on pattern matching and strings References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Fred Smith wrote: > Hi, > > Instead of altering the language why not > > type printerCommands = PrinterSetUnit | ...;; > > and the function > > match with > | "\027(U\001\000\005" -> PrinterSetUnit > | ... -> (* other cases *) > | "" -> assert false > > The rest of your program can then be independent of these bizarre strings. Not really. I need to use these strings in a couple of different places, so I'd like to be able to define them only once, as constant identifiers, or aliases, and forget them entirely. Alex ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners