Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] infix precedence
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: John Prevost <j.prevost@c...>
Subject: Re: [Caml-list] infix precedence
>>>>> "zd" == dengping zhu <zhudp@cs.bu.edu> 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