Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Alessandro Baretta <a.baretta@barettadeit.com>
To: Ocaml <caml-list@inria.fr>
Subject: Associativity of new operators
Date: Fri, 20 Jan 2006 17:06:57 +0100	[thread overview]
Message-ID: <43D10AA1.8050102@barettadeit.com> (raw)

# 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



             reply	other threads:[~2006-01-20 16:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-20 16:06 Alessandro Baretta [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43D10AA1.8050102@barettadeit.com \
    --to=a.baretta@barettadeit.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox