caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: John Prevost <j.prevost@gmail.com>
To: Ocaml Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] Associativity precedence for the user-defined operator.
Date: Fri, 23 Jul 2004 15:52:15 -0400	[thread overview]
Message-ID: <d849ad2a040723125225316cce@mail.gmail.com> (raw)
In-Reply-To: <41014DE9.5020606@ens-lyon.fr>

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


      reply	other threads:[~2004-07-23 19:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-23 14:27 Claudio Trento
2004-07-23 14:36 ` Richard Jones
2004-07-23 17:42 ` Jean-Baptiste Rouquier
2004-07-23 19:52   ` John Prevost [this message]

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=d849ad2a040723125225316cce@mail.gmail.com \
    --to=j.prevost@gmail.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;
as well as URLs for NNTP newsgroup(s).