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 IAA06814; Thu, 7 Nov 2002 08:22:30 +0100 (MET) 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 IAA07296 for ; Thu, 7 Nov 2002 08:22:29 +0100 (MET) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id gA77MQD08690 for ; Thu, 7 Nov 2002 08:22:27 +0100 (MET) Received: from localhost (suiren.kurims.kyoto-u.ac.jp [130.54.16.25]) by kurims.kurims.kyoto-u.ac.jp (8.9.3/3.7W) with ESMTP id QAA14822; Thu, 7 Nov 2002 16:22:20 +0900 (JST) To: taha@cs.rice.edu Cc: caml-list@inria.fr Subject: Re: [Caml-list] dynamic runtime cast in Ocaml In-Reply-To: References: <20021106135428.A8640@pauillac.inria.fr> X-Mailer: Mew version 1.94.2 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20021107162220A.garrigue@kurims.kyoto-u.ac.jp> Date: Thu, 07 Nov 2002 16:22:20 +0900 From: Jacques Garrigue X-Dispatcher: imput version 20000228(IM140) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk From: Walid Taha > Were nested quantifiers (either existentials or universals) considered in > the context of OCaml? If not, are there plans to add them? Thanks. I'm not sure of what you are asking about, and whether this is relevant to the question of runtime casts. If this is a question of type systems, then yes there are nested universal quantifiers in ocaml, which you can use either through object types (polymorphic methods), record types (polymorphic fields) or the module system (not first-class quantification, but this was not explicit in your question). For existential quantification, you only get it more or less with modules. Note that modules defined by "let module" are a bit weak in this context, as the types they define cannot escape their scope. Does this answer your question, or were you talking about something else? By the way, for the expressivity addict (Curry-style), there is now a branch in CVS with support for a specific form of dependent types. You can get it by cvs update -r multimatch `cat testlabl/dirs_multimatch` (when it is not broken). I plan to provide it as a patch after the next release. This allows you to do things like: # let convert x y = multimatch y with `Int -> x | `Float -> float x | `String -> string_of_int x;; val convert : int -> [< `Float & 'a = float | `Int & 'a = int | `String & 'a = string] -> 'a = # convert 3 `String;; - : string = "3" # convert 2 `Float;; - : float = 2. and this without any overloading... --------------------------------------------------------------------------- Jacques Garrigue Kyoto University garrigue at kurims.kyoto-u.ac.jp JG ------------------- 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