From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 3D642BB9C for ; Thu, 15 Sep 2005 22:48:38 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j8FKmbiA008743 for ; Thu, 15 Sep 2005 22:48:37 +0200 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 WAA26325 for ; Thu, 15 Sep 2005 22:48:37 +0200 (MET DST) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.206]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j8FKmaUJ028938 for ; Thu, 15 Sep 2005 22:48:36 +0200 Received: by rproxy.gmail.com with SMTP id b11so98247rne for ; Thu, 15 Sep 2005 13:48:36 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=VdaVy4CxPh/P7yxBRZtqYwPhewtKelfhIuouvIKB+N1MBKq+6k+25D83Xk4FQRa4II7Md32wU8Ns3ZIluo2ARmG4bOlZ8fiikXx7JEyDKmOR4+X4jMspuxQKUQ3Ia+80ROFAV9qTJhI83WNNRkj3mbFigpozgs3fyt6JWgGu5to= Received: by 10.38.12.37 with SMTP id 37mr333839rnl; Thu, 15 Sep 2005 13:48:36 -0700 (PDT) Received: by 10.38.74.51 with HTTP; Thu, 15 Sep 2005 13:48:35 -0700 (PDT) Message-ID: <53c6559205091513486a10b481@mail.gmail.com> Date: Thu, 15 Sep 2005 22:48:36 +0200 From: David Baelde Reply-To: david.baelde@ens-lyon.org To: caml-list@inria.fr Subject: Heritage Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Miltered: at concorde with ID 4329DE25.007 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 4329DE24.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; buffer:01 lexing:01 buf:01 buf:01 token:01 buffer:01 ...:98 ...:98 parsed:01 inherit:01 coerce:02 color:97 objects:02 inheritance:03 problem:05 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.3 Hi list, We're getting crazy with some design problem. We need to design a buffer object and be able to extend it with some features (lexing,color highlighting... yes we're working on an editor). Here's the problem. I'd like to have a class (or function) for every extension. For example be able to write new parsed (new lexed (new basic)). I.e. I would need the class: class lexed buf =3D object inherit buf method get_token =3D ... end It doesn't work cause inheritance is only from classes, not objects. But I want buf to be of any class (any super-class of buffer actually) but I don't want to coerce buf to type buffer, cause I want to keep extra methods if any were added. I'd like to know if there's any simple example of why object-inheritance is forbidden, and if any of you have an idea for that problem.. Thanks. --=20 David