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 LAA07571; Fri, 16 Jan 2004 11:26:26 +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 LAA07560 for ; Fri, 16 Jan 2004 11:26:24 +0100 (MET) Received: from decis.be ([194.78.219.157]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id i0GAQN512087 for ; Fri, 16 Jan 2004 11:26:24 +0100 (MET) Received: from decis.be ([192.168.0.20]) (authenticated user fplancke@decis.be) by decis.be (decis.be [194.78.219.157]) (MDaemon.PRO.v6.8.5.R) with ESMTP id 36-md50000000136.tmp for ; Fri, 16 Jan 2004 11:25:58 +0100 Message-ID: <4007BC36.3600A6DA@decis.be> Date: Fri, 16 Jan 2004 11:25:58 +0100 From: Frederic van der Plancke Reply-To: fvdp@decis.be Organization: Decis X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] Stupid question References: <20040116094357V.garrigue@kurims.kyoto-u.ac.jp> <16391.41836.251525.54048@ithif51.inf.tu-dresden.de> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Authenticated-Sender: fplancke@decis.be X-Spam-Processed: decis.be, Fri, 16 Jan 2004 11:25:58 +0100 (not processed: message from valid local sender) X-MDRemoteIP: 192.168.0.20 X-Return-Path: fvdp@decis.be X-MDaemon-Deliver-To: caml-list@inria.fr X-Loop: caml-list@inria.fr X-Spam: no; 0.00; plancke:01 fvdp:01 caml-list:01 stupid:01 hendrik:01 tews:01 val:01 val:01 int:01 toplevel:01 toplevel:01 writes:01 syntax:02 syntax:02 variant:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hendrik Tews wrote: > > Brian Hurt writes: > > OK. This makes more sense. Well, except for the nitpicking detail that > true and false are not valid variant type identifiers, they should be True > and False. > > There is a special exception: true, false, [], (), and :: are > constructor names, see 6.3 Naming objects. One can ideed write > > # type x = true of int | () of string | :: of float But you better have a pair of types after '::' ;-) # let x = true 123;; val x : x = true 123 # let y = () "eh eh";; val y : x = () "eh eh" # let z = :: 1.5;; Toplevel input: # let z = :: 1.5;; ^^ Syntax error # let z = 1.5 ::;; Toplevel input: # let z = 1.5 ::;; ^^ Syntax error # let z = 1.5 :: 1.5;; Toplevel input: # let z = 1.5 :: 1.5;; ^^^^^^^^^^ This expression has type float * float but is here used with type float Frédéric vdP ------------------- 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