* Adding methods to an object
@ 2007-11-17 14:43 Jon Harrop
2007-11-23 13:41 ` [Caml-list] " Peng Zang
0 siblings, 1 reply; 2+ messages in thread
From: Jon Harrop @ 2007-11-17 14:43 UTC (permalink / raw)
To: caml-list
Given an object that provides a variety of methods, how do you create an
return an object that augments the given object with more methods?
--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?e
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Caml-list] Adding methods to an object
2007-11-17 14:43 Adding methods to an object Jon Harrop
@ 2007-11-23 13:41 ` Peng Zang
0 siblings, 0 replies; 2+ messages in thread
From: Peng Zang @ 2007-11-23 13:41 UTC (permalink / raw)
To: caml-list
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hey Jon,
I was hoping someone else would answer your question and enlighten me as well,
but that doesn't appear to be happening. Sooo, here's my .02
I don't think there's an easily way to do this for an arbitrary object. The
main problem being the difficulty with ensuring that the return object has
the same methods as the original (plus some others). That would require
inheritance at an object level as opposed to class level.
Alternatively if one knew how messages to objects happen, one could create a
wrapper object to provide the new methods and passthrough any messages it
doesn't recognize. But I have no idea how the internals of messaging
happens.
Peng
On Saturday 17 November 2007 09:43:59 am Jon Harrop wrote:
> Given an object that provides a variety of methods, how do you create an
> return an object that augments the given object with more methods?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)
iD8DBQFHRtisfIRcEFL/JewRAtu3AKCX4EsMl2voDuUlg49X78uM0ZgPiQCeMHBt
7K3oParomxx8Td4ewoa3u/4=
=Z9Zz
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-11-23 13:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-17 14:43 Adding methods to an object Jon Harrop
2007-11-23 13:41 ` [Caml-list] " Peng Zang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox