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 RAA17354; Tue, 23 Dec 2003 17:00:08 +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 RAA17586 for ; Tue, 23 Dec 2003 17:00:06 +0100 (MET) Received: from mwinf0202.wanadoo.fr (smtp2.wanadoo.fr [193.252.22.29]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id hBNG06b16593 for ; Tue, 23 Dec 2003 17:00:06 +0100 (MET) Received: from oops (ARennes-303-1-17-154.w81-51.abo.wanadoo.fr [81.51.43.154]) by mwinf0202.wanadoo.fr (SMTP Server) with ESMTP id 008B4A40023E; Tue, 23 Dec 2003 17:00:06 +0100 (CET) Received: from david by oops with local (Exim 3.35 #1 (Debian)) id 1AYox3-0000iD-00; Tue, 23 Dec 2003 17:00:05 +0100 To: ronniec95@lineone.net Cc: caml-list@inria.fr Subject: Re: [Caml-list] type equality help (camlidl related but not directly) References: <3FB8EA9C00092F61@mk-cpfrontend-2.mail.uk.tiscali.com> From: David MENTRE Organization: none Date: Tue, 23 Dec 2003 17:00:04 +0100 In-Reply-To: <3FB8EA9C00092F61@mk-cpfrontend-2.mail.uk.tiscali.com> (ronniec95@lineone.net's message of "Tue, 23 Dec 2003 15:49:31 +0000") Message-ID: <87fzfbjzi3.fsf@linux-france.org> User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 dmentre:01 ronniec:01 lineone:01 enum:01 foo:01 foo:01 dmentre:01 camlidl:01 equality:01 writes:01 mentre:01 mentre:01 string:03 string:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hello, ronniec95@lineone.net writes: > type union_9 = > | NUMERIC > | STRING > | TBOOL > | ENUM_DATA > | CONTROL > | ENCRYPT > and msg_type = union_9 > > let foo x : msg_type option = x ^^^^^^Here is the trick > If I try to do > > # foo STRING;; > Characters 4-10: > foo STRING;; > ^^^^^^ > This expression has type union_9 but is here used with type msg_type option You should do : # foo (Some STRING);; - : msg_type option = Some STRING foo is defined as an option (| None | Some of 'a) over msg_type. Yours, d. -- David Mentré http://www.linux-france.org/~dmentre/david-mentre-public-key.asc GnuPG key fingerprint: A7CD 7357 3EC4 1163 745B 7FD3 FB3E AD7C 2A18 BE9E ------------------- 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