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 QAA06750; Mon, 3 Feb 2003 16:14:06 +0100 (MET) 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 QAA06405 for ; Mon, 3 Feb 2003 16:14:05 +0100 (MET) Received: from nef.ens.fr (nef.ens.fr [129.199.96.32]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h13FE4f05201 for ; Mon, 3 Feb 2003 16:14:05 +0100 (MET) Received: from cedre.ens.fr (cedre.ens.fr [129.199.99.47]) by nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id h13FE4M10733 for ; Mon, 3 Feb 2003 16:14:04 +0100 (CET) Received: from (dejaeger@localhost) by cedre.ens.fr (8.11.2/jb-1.1) To: OCaml List Subject: Re: [Caml-list] xor on booleans References: <15934.30328.890419.546763@lachesis.inria.fr> From: Frederic De Jaeger Date: 03 Feb 2003 16:14:04 +0100 In-Reply-To: <15934.30328.890419.546763@lachesis.inria.fr> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >> For type safety, it would be better to have >> >> let (^^) (x:bool) (y:bool) = x <> y FLF> Type safety is not lost, since (^^) is just equivalent to (<>), which FLF> is polymorph. The polymorphic (^^) is better if I want to define my FLF> own boolean type: type bool = True | False, and use (^^) with it. That's the point, it is polymorph. Personally, I rarely need to define my own boolean type. On the contrary, I like that such code is refused (I mistakenly have typed two '^' instead of one. That happens) let s = "hello " ^^ "word" in ... That's why I suggested to restrict the allowed type of (^^). ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners