caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Andrzej M. Ostruszka" <ostruszk@order.if.uj.edu.pl>
To: Caml List <caml-list@inria.fr>
Subject: [Caml-list] Specifying precedence ...
Date: Wed, 14 Mar 2001 18:48:13 +0100	[thread overview]
Message-ID: <20010314184813.A15130@order.if.uj.edu.pl> (raw)

Hello,

Is it possible to specify precedence of an "operator"?
E.g. if I have something like

let (^^) x y =
  let rec pow res y p =
    if y = 0 then res
    else
      let newres = if y land 1 <> 0 then res * p else res in
      pow newres (y lsr 1) (p*p)
  in
    pow 1 y x

then I'd like to evaluate 2*3^^2 to 18 (not 36).

						Best regards
-- 
    ____   _  ___
   /  | \_/ |/ _ \		Andrzej Marek Ostruszka
  / _ |     | (_) | Instytut Fizyki, Uniwersytet Jagiellonski (Cracow)
 /_/ L|_|V|_|\___/	(PGP <-- finger ostruszk@order.if.uj.edu.pl)
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


             reply	other threads:[~2001-03-15  7:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-14 17:48 Andrzej M. Ostruszka [this message]
2001-03-15  7:43 ` Jacques Garrigue

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=20010314184813.A15130@order.if.uj.edu.pl \
    --to=ostruszk@order.if.uj.edu.pl \
    --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).