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 HAA07093; Wed, 25 Apr 2001 07:45:40 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id HAA07105 for ; Wed, 25 Apr 2001 07:45:39 +0200 (MET DST) Received: from staff.cs.usyd.edu.au (staff.cs.usyd.edu.au [129.78.8.1]) by nez-perce.inria.fr (8.11.1/8.10.0) with SMTP id f3P5jXP05637 for ; Wed, 25 Apr 2001 07:45:34 +0200 (MET DST) Received: from hons.cs.usyd.edu.au. by staff.cs.usyd.edu.au.; Wed, 25 Apr 2001 15:45:29 +1000 Received: from localhost (mrak@localhost) by hons.cs.usyd.edu.au (8.9.3/8.9.3) with ESMTP id PAA21621 for ; Wed, 25 Apr 2001 15:45:28 +1000 X-Authentication-Warning: hons.cs.usyd.edu.au: mrak owned process doing -bs Date: Wed, 25 Apr 2001 15:45:28 +1000 (EST) From: Mark Wotton hons2001 To: caml-list@inria.fr Subject: Re: [Caml-list] Subtypes in Ocaml In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, 25 Apr 2001, Mark Wotton hons2001 wrote: > How do you do subtypes in Ocaml? I'm writing a parser in which I want > literals to be treated as expressions, but I also want to be able to treat > them as literals in other contexts; ie, I need to be able to ensure that > I'm being passed a literal at one point (for case statements), but I don't > want to have to treat literals specially when they're being used somewhere > in which a normal expression is allowable. > > This may be a stupid question, but I can't find an answer I can understand > in the docs. Patternmatching seems to do it. if this isn't the right way to do it, please, someone let me know before i do something stupid. mrak ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr