From: Daniel de Rauglaudre <daniel.de_rauglaudre@inria.fr>
To: Ocaml <caml-list@inria.fr>
Subject: Re: [Caml-list] infix precedence
Date: Wed, 29 May 2002 10:42:40 +0200 [thread overview]
Message-ID: <20020529104240.D30629@verdot.inria.fr> (raw)
In-Reply-To: <Pine.SOL.4.20.0205282247140.28396-100000@csa.bu.edu>; from zhudp@cs.bu.edu on Tue, May 28, 2002 at 10:48:33PM -0400
Hi,
On Tue, May 28, 2002 at 10:48:33PM -0400, dengping zhu wrote:
> Hi, Daniel, it works very well.
> Thanks a lot!
Thanks. BTW, another way to turn around the problem of "let (op1) x y"
which does not work (the problem is actually more complicated that I
thought), you can give the function another name, for example by
changing:
[ [ x = SELF; $op$; y = SELF -> <:expr< $lid:op$ $x$ $y$ >> ] ];
into:
[ [ x = SELF; $op$; y = SELF -> <:expr< $lid:"f_" ^ op$ $x$ $y$ >> ] ];
This way, when doing
add_infix "*" "op1"
the rule creates the infix "op1" associated with the function "f_op1"
that you can define without parsing problem with:
let f_op1 x y = ...
and "a op1 b" is therefore equivalent to "f_op1 a b".
--
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
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
next prev parent reply other threads:[~2002-05-29 8:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-28 15:42 dengping zhu
2002-05-28 15:54 ` Remi VANICAT
2002-05-28 16:00 ` John Prevost
2002-05-28 17:19 ` dengping zhu
2002-05-28 18:07 ` John Prevost
2002-05-28 18:16 ` dengping zhu
2002-05-28 18:32 ` Daniel de Rauglaudre
2002-05-28 18:48 ` dengping zhu
2002-05-28 22:44 ` Daniel de Rauglaudre
2002-05-29 2:48 ` dengping zhu
2002-05-29 8:42 ` Daniel de Rauglaudre [this message]
2002-06-21 17:54 ` dengping zhu
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=20020529104240.D30629@verdot.inria.fr \
--to=daniel.de_rauglaudre@inria.fr \
--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