RE: [Rubydotnet-developer] System.Reflection.Binder
Status: Alpha
Brought to you by:
thomas
From: Ben S. <bsc...@pr...> - 2003-09-07 22:22:54
|
Hi Thomas, We had similar feelings about the default binder, its functionality, and = its private-ness. What we've done is to delegate to the default binder instead of inherit = from its class. We do parameter conversions when necessary - almost = exactly like your pseudocode! - and then ask the default binder if it = can find a match. The binder interface provides us with a list of = possible matches, so we do loop over all of them looking for a = conversion set that allows the default binder to bind something (if that = makes sense). If you have any questions about the above or other aspects of the = binding - please ask! Regards, Ben -----Original Message----- From: Thomas Sondergaard [mailto:th...@th...] Sent: Sun 9/7/2003 9:56 AM To: rub...@li... Cc:=09 Subject: [Rubydotnet-developer] System.Reflection.Binder Hi guys, I've been doing things a little backwards and I've now got interface implementation from ruby running. I've also got the code ready for = creating a delegate from a proc, but I'm still missing the plumming to use it. = I'm wondering how to automatically convert proc objects into the appropriate Delegate type. Type.InvokeMember uses a System.Reflection.Binder object = to do the actual binding, so I could subclass Binder and have it do it. Unfortunately you cannot subclass the default binder and I'm not keen on having to replicate whatever functionality is in it, especially as I = don't really know all of what it does. How have you gone about this problem? I wish there was a way to add specific parameter conversions that would = be allowed during member resolution and binding, without having to = sacrifice the properties of the default binder. All I really want is that during parameter matching, the following would be considered (pseudo code) if (requiredParameterType is a delegateType && actualParameter is IProc) convertedParameter =3D = TypedDelegateFactory.create(requiredParameterType, actualParameter, "call') (Type TypedDelegateFactory.create(Type delegateType, IObject obj, string methodName) is the bit I've already got) Suggestions? Cheers, Thomas ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Rubydotnet-developer mailing list Rub...@li... https://lists.sourceforge.net/lists/listinfo/rubydotnet-developer |