caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Heritage
@ 2005-09-15 20:48 David Baelde
  2005-09-15 21:25 ` [Caml-list] Heritage Corey O'Connor
  0 siblings, 1 reply; 6+ messages in thread
From: David Baelde @ 2005-09-15 20:48 UTC (permalink / raw)
  To: caml-list

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 =
object inherit buf method get_token = ... 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.
-- 
David


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-09-15 22:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-15 20:48 Heritage David Baelde
2005-09-15 21:25 ` [Caml-list] Heritage Corey O'Connor
2005-09-15 22:01   ` David Baelde
2005-09-15 22:15     ` Corey O'Connor
2005-09-15 22:38       ` skaller
2005-09-15 22:58         ` Corey O'Connor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).