From: mahamud@cs.cmu.edu
To: caml-list@inria.fr
Subject: Re: [Caml-list] semi-colons and begin
Date: Wed, 4 Apr 2001 21:03:42 -0400 (EDT) [thread overview]
Message-ID: <15051.47224.795222.890002@marr.ius.cs.cmu.edu> (raw)
In-Reply-To: <4.3.2.7.2.20010404162926.033b0c00@shell16.ba.best.com>
>>>>> ">" == Chris Hecker <checker@d6.com> 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
next prev parent reply other threads:[~2001-04-05 1:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-04 21:33 Chris Hecker
2001-04-04 22:40 ` Gerd Stolpmann
2001-04-04 23:32 ` Chris Hecker
2001-04-05 1:03 ` mahamud [this message]
2001-04-05 3:48 ` Brian Rogoff
2001-04-05 6:05 ` David Brown
2001-04-06 9:33 ` Gerd Stolpmann
2001-04-05 3:35 ` Michael Hicks
2001-04-05 3:53 ` Daniel de Rauglaudre
2001-04-05 6:23 ` Mattias Waldau
2001-04-05 17:34 ` Pierre Weis
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=15051.47224.795222.890002@marr.ius.cs.cmu.edu \
--to=mahamud@cs.cmu.edu \
--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