From: Thorsten Ohl <ohl@crunch.ikp.physik.th-darmstadt.de>
To: Pierre Weis <Pierre.Weis@inria.fr>
Cc: caml-list@margaux.inria.fr
Subject: Re: entiers et reels
Date: Fri, 5 Jan 1996 22:14:07 +0100 [thread overview]
Message-ID: <9601052114.AA03157@crunch> (raw)
In-Reply-To: <199601051827.TAA27239@pauillac.inria.fr>
>>>>> "Pierre" == Pierre Weis <Pierre.Weis@inria.fr> writes:
Pierre> En revanche il n'y a pas de sens raisonable a` une addition
Pierre> polymorphe, et c'est pourquoi nous avons une collection
Pierre> d'additions monomorphes.
[ No, I'm not going to embarrass myself by trying to respond in
French ... :-) ]
Maybe I'm too dense or I have been exposed to too much Fortran, but I
don't fully understand:
Standard ML has it (at least in the New Jersey incarnation), so why
can't Caml? As long as all operands are of the same type, the
semantics should be obvious.
I agreee that promotion will open a can of worms (standard example:
(1/2)*2.0 would most likely evaluate to 0.0, which is even more likely
_not_ what the programmer intended). But wouldn't it be possible to
assign types to subexpressions based on the context in such a way that
no information can be lost?
I asking out of curiosity, but from the user's perspective I want to
add that polymorphic arithmetic is just soooo convenient. It can be
abused, but it can also make programs much more readable, if used with
discretion. In particular if types have a natural inclusion (like
natural, integer, rational, real and complex numbers). Also for
vector spaces: it is usually not ambigious whether a scalar or an
inner product is intended.
Greetings,
-Thorsten
/// Thorsten Ohl, TH Darmstadt, Schlossgartenstr. 9, D-64289 Darmstadt, Germany
//// http://crunch.ikp.physik.th-darmstadt.de/~ohl //// voice: +49-6151-16-3116
///// email: Thorsten.Ohl@Physik.TH-Darmstadt.de /// secretary: 2072, fax: 2421
next prev parent reply other threads:[~1996-01-07 23:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-01-05 9:05 Fauque UPS
1996-01-05 18:27 ` Pierre Weis
1996-01-05 21:14 ` Thorsten Ohl [this message]
1996-01-08 9:40 ` Xavier Leroy
1996-01-05 20:13 quercia
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=9601052114.AA03157@crunch \
--to=ohl@crunch.ikp.physik.th-darmstadt.de \
--cc=Pierre.Weis@inria.fr \
--cc=caml-list@margaux.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