English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] infix precedence
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-05-28 (18:16)
From: dengping zhu <zhudp@c...>
Subject: Re: [Caml-list] infix precedence
Hi, John, thanks for your help.  Hope I could solve it today.
Anyway, I think that Ocaml should support infix as SML.


On 28 May 2002, John Prevost wrote:

>>>>>> "zd" == dengping zhu <zhudp@cs.bu.edu> writes:
>    zd> I want to convert these code into ocaml. How can find so many
>    zd> different 'first characters'? Because the available characters
>    zd> in ocaml are:
>    zd> **...  right *... /... %...  left +... -...  left @... ^...
>    zd> right
>    zd> Do you have any sugestion?
>Take a look at section 6.7 of the manual for precedence rules, and
>section 6.1 (under the heading "Prefix and infix symbols") for the
>list of symbols.  In short, this is the list of all the available
>infix symbols, in order of precedence:
>!... ?... ~...                          prefix
>**...                                   right
>*... /... %...                          left
>+... -...                               left
>@... ^...                               right
>=... <... >... |... &... $... %...      left
>This means that you might have some trouble with your infix levels,
>but there are normally ways to organize things for what you'd like.  I
>find, also, that having just a few levels and using parenthesis for
>the rest of the time can work quite well.  As you note, using this
>style for everything can be painful, but having infixes for only a few
>specific things can help immensely.
>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

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