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 WAA14141; Fri, 6 Sep 2002 22:18:24 +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 WAA14462 for ; Fri, 6 Sep 2002 22:18:23 +0200 (MET DST) Received: from wetware.wetware.com (wetware.wetware.com [199.108.16.1]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g86KIM114949 for ; Fri, 6 Sep 2002 22:18:23 +0200 (MET DST) Received: from kallisti.local.(ra02.wetware.com[199.108.16.82]) (1364 bytes) by wetware.wetware.com via sendmail with P:esmtp/R:bind_hosts/T:inet_zone_bind_smtp (sender: ) id for ; Fri, 6 Sep 2002 13:18:16 -0700 (PDT) (Smail-3.2.0.114 2001-Aug-6 #1 built 2002-Sep-2) Date: Fri, 6 Sep 2002 13:18:17 -0700 Subject: Re: [Caml-list] Allow declaring classes "final" so self type has no type variables? Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v543) Cc: The Trade To: tim@fungible.com (Tim Freeman) From: james woodyatt In-Reply-To: <20020906192333.1663A7F9A@lobus.fungible.com> Message-Id: Content-Transfer-Encoding: 7bit X-Mailer: Apple Mail (2.543) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Friday, Sep 6, 2002, at 12:12 US/Pacific, Tim Freeman wrote: > > Any comments on whether this is a good idea? Hide the class with a module signature. Publish only the class type and one or more functions for constructing objects. In other words, don't put your "class node" in the module type. Instead just define a function: val create_node: parent:nodetype option -> nodetype The way to prevent programmers from using your class in an "inherit" clause is to not give them the class in the first place. Just give them the class type and a collection of functions. -- j h woodyatt markets are only free to the people who own them. ------------------- 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