caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Associativity of new operators
@ 2006-01-20 16:06 Alessandro Baretta
  2006-01-20 16:13 ` [Caml-list] " William D. Neumann
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Alessandro Baretta @ 2006-01-20 16:06 UTC (permalink / raw)
  To: Ocaml

# let (++) = (-);;
val ( ++ ) : int -> int -> int = <fun>
# 10 ++ 4 ++ 6;;
- : int = 0
# let (@@) = (-);;
val ( @@ ) : int -> int -> int = <fun>
# 10 @@ 4 @@ 6;;
- : int = 12

The above toplevel session shows that the associativity of newly defined 
operators depends on the name of the operator itself. Is there a general rule to 
determine the associativity of the operator?

Alex



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-01-20 16:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-20 16:06 Associativity of new operators Alessandro Baretta
2006-01-20 16:13 ` [Caml-list] " William D. Neumann
2006-01-20 16:17 ` Julien Signoles
2006-01-20 16:37   ` Alessandro Baretta
2006-01-20 16:18 ` Eric Cooper
2006-01-20 16:18 ` David MENTRE
2006-01-20 16:45 ` Richard Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).