From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id DAA21264; Thu, 5 Apr 2001 03:04:24 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id DAA21389 for ; Thu, 5 Apr 2001 03:04:23 +0200 (MET DST) Received: from marr.ius.cs.cmu.edu (MARR.IUS.CS.CMU.EDU [128.2.242.179]) by concorde.inria.fr (8.11.1/8.10.0) with SMTP id f3514Jr06360 for ; Thu, 5 Apr 2001 03:04:20 +0200 (MET DST) Date: Wed, 4 Apr 2001 21:03:42 -0400 (EDT) From: mahamud@cs.cmu.edu To: caml-list@inria.fr Subject: Re: [Caml-list] semi-colons and begin In-Reply-To: <4.3.2.7.2.20010404162926.033b0c00@shell16.ba.best.com> References: <4.3.2.7.2.20010404142255.0338a1c0@shell16.ba.best.com> <01040500584807.00489@ice> <4.3.2.7.2.20010404162926.033b0c00@shell16.ba.best.com> X-Mailer: VM 6.43 under 20.4 "Emerald" XEmacs Lucid Message-ID: <15051.47224.795222.890002@marr.ius.cs.cmu.edu> Mime-Version: 1.0 (generated by tm-edit 7.108) Content-Type: text/plain; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >>>>> ">" == Chris Hecker writes: >> However, in the O'Caml manual there is a precedence table >> (section 6.7) determining that "if" has higher precedence than >> ";". So the first way is what the compiler interprets. on an unrelated point, speaking of precedence rules, is there a good reason why unary minus for floats (-.) has higher precedence than power of (**). i think the usual precedence is the other way. atleast this is what i'm used to in languages that are primarily numerically oriented like matlab. i've been caught by this quite a few times. another minor point regarding syntax : the use of "(* ... *)" prevents one from passing the multiplication "*" operator as an argument (say to List.map2) without padding some space as in : ( * ) as opposed to (*). it's a small point, but i don't think i've come across such unintended interactions between comments and other constructs in other languages. while i still have your attention, one last comment : as you may have guessed i primarily use OCAML for writing code that mostly do number crunching. i know you've all seen others writing similar code beg for something like overloading. and i want to chime in too for what its worth : why can't OCAML do what SML does ? overload the standard arithmetic operators to do both int and double and assume a default type if the type can't be inferred. this would i think avoid the majority of annoyances for people who use OCAML for number crunching. I don't know if there is a deep issue involved that prevents OCAML from doing what SML does, but it seems inconsistent from a user's viewpoint that for eg. the comparison operators are allowed to be overloaded but not the arithmetic operators. perhaps the comparison operators are easier to overload since the result returned always has the same type ? - shyjan ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr