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 RAA32523; Wed, 29 Jan 2003 17:35:48 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 RAA32704 for ; Wed, 29 Jan 2003 17:35:47 +0100 (MET) Received: from ns.mccme.ru ([195.133.68.22]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h0TGZav19120 for ; Wed, 29 Jan 2003 17:35:38 +0100 (MET) Received: from mccme.ru (potanin@mccme.ru [195.178.198.7]) by ns.mccme.ru (8.8.5/8.8.5) with SMTP id TAA21870 for ; Wed, 29 Jan 2003 19:18:55 +0300 Date: Wed, 29 Jan 2003 19:51:58 +0300 (MSK) From: Mike Potanin To: caml-list@inria.fr Subject: Re: [Caml-list] AST and "when" In-Reply-To: <15927.63109.279741.539157@akasha.ijm.jussieu.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, 29 Jan 2003, Olivier Andrieu wrote: Whether I can make "formula" quotation so it compile match e with <:formula< sin(@x) ^ 2 + cos(@x) ^ 2 >> -> <:formula< 1 >> to match e with (Sum [(Pow1 (Sin x) 2); (Pow1 (Cos x_temp) 2)]) when x==x_temp -> Const 1 Or I mast write match e with <:formula< sin(@x) ^ 2 + cos(@y) ^ 2 >> when x==y -> <:formula< 1 >> > Mike Potanin [Wednesday 29 January 2003] : > > I don't think so: in `a when a<0', only the first `a' is a pattern, > the when + expr is part of the `match' (or `try' or `function') > construct which is at the expression level. > > > (MLast.PaLid ((0, 0), "a"), > > Some > > (MLast.ExApp ((0, 0), > > MLast.ExApp ((0, 0), MLast.ExLid ((0, 0), "<"), > > MLast.ExLid ((0, 0), "a")), > > MLast.ExInt ((0, 0), "0"))) > > that's not a single pattern (MLast.patt), that's a tuple of type > `MLast.patt * MLast.expr option' ------------------- 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