caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Delegation based OO
@ 2004-03-22 10:18 Alex Baretta
  2004-03-22 23:01 ` Yamagata Yoriyuki
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Alex Baretta @ 2004-03-22 10:18 UTC (permalink / raw)
  To: Ocaml

Away from politics and back to the ordinary stuff...

Presently Ocaml supports the following OO paradigm:

class does_something = object .. end

class does_more = object
   inherit does_something
   ...
end

This allows us to extend the functionality of CLASSES. What about 
extending the functionality of objects?

class *type* does_something = object ... end

class does_more (an_object:#does_something) = object
   delegates an_object
   ...
end

This is very important to me because in my code I often use the concept 
of proxy-object.

let prototype = match whatever with
   | ... as first_case -> new does_it_the_first_way
   | ... as second_case -> new does_it_the_second_way
   | ... as third_case -> new does_it_the_third_way

class does_more prototype = object
   method one = prototype # one
   method two = protype # two
   ...
end

This is really a pain. I would expect delegation to be supported in the 
coolest OO language under the sun ;)

O great Caml breeders, what do you say to this?

Alex

-------------------
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] 16+ messages in thread

end of thread, other threads:[~2004-03-24 16:57 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-22 10:18 [Caml-list] Delegation based OO Alex Baretta
2004-03-22 23:01 ` Yamagata Yoriyuki
2004-03-23  0:29   ` Kenneth Knowles
2004-03-23 23:43     ` Yamagata Yoriyuki
2004-03-24  0:45       ` Kenneth Knowles
2004-03-24 10:43         ` Alex Baretta
2004-03-24 14:11           ` Yamagata Yoriyuki
2004-03-24 15:00             ` Alex Baretta
2004-03-24 16:57           ` Kenneth Knowles
2004-03-23  1:14 ` Jacques Garrigue
2004-03-23  7:27   ` Alex Baretta
2004-03-23  9:01   ` Stefano Zacchiroli
2004-03-23  9:41     ` Alex Baretta
2004-03-23  9:44     ` Jacques Garrigue
2004-03-23  9:47       ` Stefano Zacchiroli
2004-03-23  8:56 ` Correnson Loïc

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