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 JAA15322; Tue, 3 Jul 2001 09:30:15 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA15318 for ; Tue, 3 Jul 2001 09:30:14 +0200 (MET DST) Received: from lri.lri.fr (lri.lri.fr [129.175.15.1]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f637UEL25946 for ; Tue, 3 Jul 2001 09:30:14 +0200 (MET DST) Received: from (filliatr@localhost) by lri.lri.fr (8.11.1/jtpda-5.3.2) id f637TWl05199 ; Tue, 3 Jul 2001 09:29:32 +0200 (MEST) From: Jean-Christophe Filliatre MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15169.29788.146259.211964@lri> Date: Tue, 3 Jul 2001 09:29:32 +0200 (MEST) To: temofey Cc: caml-list@inria.fr Subject: Re: [Caml-list] About overloading( + +. and <) In-Reply-To: <19838.010702@sit.kiev.ua> References: <19838.010702@sit.kiev.ua> X-Mailer: VM 6.49 under Emacs 20.7.1 Reply-To: Jean-Christophe.Filliatre@lri.fr (Jean-Christophe Filliatre) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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