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 KAA01469; Wed, 29 May 2002 10:42:46 +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 KAA01609 for ; Wed, 29 May 2002 10:42:45 +0200 (MET DST) Received: from verdot.inria.fr (verdot.inria.fr [128.93.11.7]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g4T8gjn19206 for ; Wed, 29 May 2002 10:42:45 +0200 (MET DST) Received: (from ddr@localhost) by verdot.inria.fr (8.9.3/8.9.3) id KAA30869 for caml-list@inria.fr; Wed, 29 May 2002 10:42:40 +0200 Date: Wed, 29 May 2002 10:42:40 +0200 From: Daniel de Rauglaudre To: Ocaml Subject: Re: [Caml-list] infix precedence Message-ID: <20020529104240.D30629@verdot.inria.fr> References: <20020529004457.B1511@verdot.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from zhudp@cs.bu.edu on Tue, May 28, 2002 at 10:48:33PM -0400 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, On Tue, May 28, 2002 at 10:48:33PM -0400, dengping zhu wrote: > Hi, Daniel, it works very well. > Thanks a lot! Thanks. BTW, another way to turn around the problem of "let (op1) x y" which does not work (the problem is actually more complicated that I thought), you can give the function another name, for example by changing: [ [ x = SELF; $op$; y = SELF -> <:expr< $lid:op$ $x$ $y$ >> ] ]; into: [ [ x = SELF; $op$; y = SELF -> <:expr< $lid:"f_" ^ op$ $x$ $y$ >> ] ]; This way, when doing add_infix "*" "op1" the rule creates the infix "op1" associated with the function "f_op1" that you can define without parsing problem with: let f_op1 x y = ... and "a op1 b" is therefore equivalent to "f_op1 a b". -- Daniel de RAUGLAUDRE daniel.de_rauglaudre@inria.fr http://cristal.inria.fr/~ddr/ ------------------- 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