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 TAA22263; Tue, 28 May 2002 19:19:37 +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 TAA22261 for ; Tue, 28 May 2002 19:19:36 +0200 (MET DST) Received: from cs.bu.edu (cs.bu.edu [128.197.12.2]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g4SHJZv23701 for ; Tue, 28 May 2002 19:19:35 +0200 (MET DST) Received: from csa.bu.edu (zhudp@csa [128.197.12.3]) by cs.bu.edu (8.12.2/8.12.2) with ESMTP id g4SHJWF2019282; Tue, 28 May 2002 13:19:32 -0400 (EDT) Received: from localhost (zhudp@localhost) by csa.bu.edu (8.10.1/8.10.1) with ESMTP id g4SHJTm05163; Tue, 28 May 2002 13:19:29 -0400 (EDT) X-Authentication-Warning: csa.bu.edu: zhudp owned process doing -bs Date: Tue, 28 May 2002 13:19:28 -0400 (EDT) From: dengping zhu X-Sender: zhudp@csa.bu.edu To: John Prevost cc: Ocaml Subject: Re: [Caml-list] infix precedence In-Reply-To: <86k7pofejb.fsf@laurelin.dementia.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Thanks for your prompt reply. So, the associativity also the same as the first character. Then, I have problems with the following code. In SML, I defined a few infix as follows: infixr 4 << >> infixr 3 && infix 2 -- ## infix 2 wth suchthat return guard infixr 1 || I want to convert these code into ocaml. How can find so many different 'first characters'? Because the available characters in ocaml are: **... right *... /... %... left +... -... left @... ^... right Do you have any sugestion? Thanks a lot! Dengping On 28 May 2002, John Prevost wrote: >>>>>> "zd" == dengping zhu writes: > > zd> Hi, all, I have a question about the precedence of infix in > zd> ocaml. I define a few infixes as follow: > > zd> let (^^) x y = ... let (^+) x y = ... let (^<) x y = ... > > zd> Now how can I define the precedence of them? At first, I want > zd> to use brackets to solve it, but later I find out it is almost > zd> impossible because there are a lot of recursive functions and > zd> combination of these infixes. > > zd> Can you give me any idea? Thanks a lot! > >The precedence and fixity of the infix is determined by the first character. This is why most "families" of infixes look like: > >^^ >+^ ><^ > >rather than > >^^ >^+ >^< > >John. > ------------------- 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