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 RAA16560; Wed, 14 Aug 2002 17:11:44 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA16551 for ; Wed, 14 Aug 2002 17:11:43 +0200 (MET DST) Received: from grisu.bik-gmbh.de (grisu.bik-gmbh.de [194.233.237.82]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g7EFBg503598 for ; Wed, 14 Aug 2002 17:11:42 +0200 (MET DST) Received: from hars.de (prony.bik-gmbh.de [194.233.237.133]) by grisu.bik-gmbh.de (8.12.3/8.11.1) with ESMTP id g7EFBgAK077669 for ; Wed, 14 Aug 2002 17:11:42 +0200 (CEST) (envelope-from florian@hars.de) Message-ID: <3D5A7329.9050505@hars.de> Date: Wed, 14 Aug 2002 17:11:37 +0200 From: Florian Hars User-Agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.0.0) Gecko/20020529 X-Accept-Language: de-de, en-us, en MIME-Version: 1.0 To: caml-list@inria.fr Subject: [Caml-list] structs and enums in camlidl Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I just noticed that you cannot use your enums as argument or return types of function if you model your IDL-file on the example from the documentation enum e {A=1, B=2, C=4}; you have to use either enum _e {...}; typedef enum _e e; or even better (since it will save a C function call even without a smart optimizer) typedef enum {...} e; to get the full benefit of the translation to a Caml enumerated type. This is of course a ( -- if you think about it long enough -- trivial) consequence of the silly struct and enum syntax of C, but I think that this idiom should probably be mentioned in the documentation. Yours, Florian. ------------------- 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