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 IAA14923; Thu, 11 Oct 2001 08:44:50 +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 IAA15971 for ; Thu, 11 Oct 2001 08:44:49 +0200 (MET DST) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by concorde.inria.fr (8.11.1/8.10.0) with SMTP id f9B6imb28289 for ; Thu, 11 Oct 2001 08:44:48 +0200 (MET DST) Received: (qmail 9493 invoked by uid 0); 11 Oct 2001 06:44:47 -0000 Received: from l0001p30.dipool.highway.telekom.at (HELO localhost) (62.46.64.30) by mail.gmx.net (mp007-rz3) with SMTP; 11 Oct 2001 06:44:47 -0000 From: "Thomas Link" To: caml-list@inria.fr Date: Thu, 11 Oct 2001 08:43:54 +0200 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: [Caml-list] Newbie question concerning type definitions Message-ID: <3BC55BCA.15676.5F0873@localhost> X-mailer: Pegasus Mail for Win32 (v3.12c) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hello, I have hesitated to send this question to this mailing list as I suspect it to be rather stupid. What am I trying to do? I would like to implement a simple stack based language in OCaml in order to get a feeling for OCaml and also to test some ideas. Well, I didn't get far as I wasn't even able to define the basic data structures. I guess this is plain wrong: type returnState = Succeeded | Failed | Error of int and proc = (stack -> dictionary -> returnState) and procs = proc list and element = Int of int | String of string | Float of float | Word of proc and stack = element Stack.t and dictionary = (string, procs) Hashtbl.t;; When compiling this, the compiler tells me that proc's definition is cyclic. How can I circumvent this in OCaml? My apologies if this is too simple-minded for being asked in this forum, but could somebody tell me please how the correct definition of these types could possibly look like? Cheers, Thomas. ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr