caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] functional objects
@ 2002-10-19  0:54 james woodyatt
  2002-10-19 20:48 ` Didier Remy
  0 siblings, 1 reply; 6+ messages in thread
From: james woodyatt @ 2002-10-19  0:54 UTC (permalink / raw)
  To: The Trade

everyone--

Before I file a wish request for this, I'd like to spark a discussion 
about it.

I really like the functional object semantics in Ocaml.  I think 
they're way cool.  I'm having a great time exploring what I can do with 
them.  Nothing really mindblowing to show for it yet, but give me time.

Anyway, one of the things I find lacking is a way to call a subclass 
constructor in the copy constructor.  In other words, I'd like to have 
some way to do the following:

	(* class type with only public methods exposed *)
	class type foo = object method f: unit end

	(* class with private members *)
	class foo x : foo = object
	  val x: int = x
	  method f = ()
	end

	(* derived functional subclass (notice method g) *)
	class bar y = object
	  inherit foo 0
	  val y: int = y
	  method g a b = {< foo a; y = b >}
	end

What I want is for a superclass class to be able to expose an interface 
to subclasses for constructing copies with arguments.  Is this a bad 
idea?  Has it already been considered and rejected?  Just curious.


-- 
j h woodyatt <jhw@wetware.com>
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


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

end of thread, other threads:[~2002-10-22  8:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-19  0:54 [Caml-list] functional objects james woodyatt
2002-10-19 20:48 ` Didier Remy
2002-10-21  4:10   ` james woodyatt
2002-10-21  6:55     ` Didier Remy
2002-10-21 18:40       ` james woodyatt
2002-10-22  8:42         ` Didier Remy

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).