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 SAA10820; Fri, 10 Jan 2003 18:17:58 +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 SAA10762 for ; Fri, 10 Jan 2003 18:17:57 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h0AHHor19076; Fri, 10 Jan 2003 18:17:50 +0100 (MET) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA10792; Fri, 10 Jan 2003 18:17:49 +0100 (MET) Date: Fri, 10 Jan 2003 18:17:49 +0100 From: Xavier Leroy To: "Yaron M. Minsky" Cc: Caml List Subject: Re: [Caml-list] Some, None and the caml-C interface Message-ID: <20030110181749.A10694@pauillac.inria.fr> References: <1042080881.25626.66.camel@dragonfly.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <1042080881.25626.66.camel@dragonfly.localdomain>; from yminsky@CS.Cornell.EDU on Wed, Jan 08, 2003 at 09:54:44PM -0500 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > I've written some simple macros for accessing options in ocaml, and I > want to double check that they are actually right. Does this look > right? Yes, it is. > And is this documented anywhere? The general representation of sum datatypes is described in section 18.3.4 of the OCaml manual. If you "instantiate" this description to the actual definition of type option type 'a option = None | Some of 'a you can derive the macros that you posted. - Xavier Leroy ------------------- 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