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 AAA12633; Sun, 29 Sep 2002 00:55:01 +0200 (MET DST) 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 AAA12623 for ; Sun, 29 Sep 2002 00:55:00 +0200 (MET DST) Received: from relay.pair.com (relay1.pair.com [209.68.1.20]) by concorde.inria.fr (8.11.1/8.11.1) with SMTP id g8SMsx503764 for ; Sun, 29 Sep 2002 00:54:59 +0200 (MET DST) Received: (qmail 6393 invoked from network); 28 Sep 2002 22:54:57 -0000 Received: from adsl-host-sf-228.apexworld.net (HELO checkerlap.d6.com) (66.114.212.228) by relay1.pair.com with SMTP; 28 Sep 2002 22:54:57 -0000 X-pair-Authenticated: 66.114.212.228 Message-Id: <4.3.2.7.2.20020928154107.03ac9a00@mail.d6.com> X-Sender: checker@mail.d6.com X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Date: Sat, 28 Sep 2002 15:46:03 -0700 To: William Lovas , caml-list@inria.fr From: Chris Hecker Subject: Re: [Caml-list] Design advice In-Reply-To: <20020928190216.GA9876@force.stwing.upenn.edu> References: <4.3.2.7.2.20020928033941.03b2eb10@mail.d6.com> <4.3.2.7.2.20020928033941.03b2eb10@mail.d6.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > let suit_to_int = function > | Spades -> 0 > | Hearts -> 1 > | Diamonds -> 2 > | Clubs -> 3 >? You only have to type it once, and if you change the constructors >around, it won't even compile. As I mentioned in my mail, let suit_to_int = function | Spades -> 0 | Hearts -> 1 | Diamonds -> 1 | Clubs -> 3 is a bug that the compiler can't find. That's why I said it was a tradeoff. Also, having to type the constructors twice in the mli and the ml is already a huge pain the ass for maintenance and refactoring in my opinion, and having to do it a third time is completely lame. But yes, magic is magic, so that's why I didn't say it was absolutely the right thing. In reality, a ton of C code depends on this and it is documented to work like this in the manual, so it's probably safe, but I don't like fencing in the compiler folks any more than necessary. Hence, "choose your poison". Chris ------------------- 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