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 EAA06692; Thu, 28 Jun 2001 04:21:59 +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 EAA07521 for ; Thu, 28 Jun 2001 04:21:58 +0200 (MET DST) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f5S2Lvf26363; Thu, 28 Jun 2001 04:21:57 +0200 (MET DST) Received: from localhost (patrick@localhost) by fledge.watson.org (8.11.3/8.11.3) with SMTP id f5S2LU021250; Wed, 27 Jun 2001 22:21:30 -0400 (EDT) (envelope-from patrick@watson.org) Date: Wed, 27 Jun 2001 22:21:29 -0400 (EDT) From: Patrick M Doane To: Jun Furuse cc: caml-list@inria.fr Subject: Re: "Re: [Caml-list] A G'Caml question" + additional info In-Reply-To: <20010625191156X.Jun.Furuse@inria.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Mon, 25 Jun 2001, Jun Furuse wrote: > Thus, the generic values are "open" to the others who include them, > but it is not the open recursion you mentioned; print and print' are > different values and independent each other. > > We do not want to introduce the full open recursion to generic > values. You could add new type cases easily using the open recursion > and it should be helpful in some cases. But it can also introduce > heavy semantic confusion to our programs, since in the open recursion > the semantics of generic values could not be fixed until all modules > are linked together. I agree that this could make programs more difficult to follow, but I think it is to be expected with generic programming these days. Also, isn't this kind of semantic confusion already present with using the object oriented system? In the following example, writing definitions like MyProgram.print may get very tedious in practice. module Int = struct generic print = case int -> unit => print_int end module String = struct generic print = case string -> unit => print_string end module List = struct generic print = case $a list -> unit => function [] -> () | x :: xs -> print x; print xs end module MyProgram = struct generic print = case | include Int.print | include String.print | include List.print (* all other print functions to follow *) end Given what is done with Haskell type classes and C++ templates, it seems more confusing to me to not support open recursion. Any thoughts? Patrick ------------------- 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