caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe Filliatre <Jean-Christophe.Filliatre@lri.fr>
To: temofey <temofey@sit.kiev.ua>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] About overloading( + +. and <)
Date: Tue, 3 Jul 2001 09:29:32 +0200 (MEST)	[thread overview]
Message-ID: <15169.29788.146259.211964@lri> (raw)
In-Reply-To: <19838.010702@sit.kiev.ua>


temofey writes:
 >
 > But compare operators like "<", ">" is the same for Integer, Float,
 > String. Are they overload? Is this contradiction in terms?
 > 

=, < and > are not overloaded, but polymorphic. It means they can be
applied to any two values of the same type, for any type (base types
but also user defined types like tuples, records, recursive 
types, etc.) except functional types (on which we don't know how to
compare values). You may have a look at
byterun/compare.c in ocaml sources to see how this comparison is defined.

It couldn't be the same for arithmetic operations (plus, minus, etc)
because we don't know how to define them on types other than int and
float.

-- 
Jean-Christophe Filliatre
  mailto:Jean-Christophe.Filliatre@lri.fr
  http://www.lri.fr/~filliatr
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


      reply	other threads:[~2001-07-03  7:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-02 17:07 temofey
2001-07-03  7:29 ` Jean-Christophe Filliatre [this message]

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=15169.29788.146259.211964@lri \
    --to=jean-christophe.filliatre@lri.fr \
    --cc=caml-list@inria.fr \
    --cc=temofey@sit.kiev.ua \
    /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;
as well as URLs for NNTP newsgroup(s).