Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Associativity precedence for the user-defined operator.
[ 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@g...>
Subject: Re: [Caml-list] Associativity precedence for the user-defined operator.
In general, the associativity and precedence of an operator (unless
you go out to camlp4 or something) is based on the operator's first
character.  For example +/ would act like +, */ would act like *, and
so on.  For this reason, you'll often see O'Caml operators defined as
"basic operator followed by some strange symbol."  In your add_num
case, +/ and friends would probably mesh well.  Then you also get the
expected interaction when mixing +/ and */.

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