What is the current state of the art on duck typing for C# below version 4.0?
I know about Duck Typing Project, I know that BLTookit has something to that end, but I'd like to know if I'm m开发者_运维知识库issing something really wicked apart from DLR languages and C# 4.0.
Use iron python inside the c# code. We've used it very successfully.
You can use the DLR for dynamic type capabilities pre .NET 4, though you can't use the dynamic keyword so it can be a pain. The remaining "Duck Typing" functionality looks like it can be had through something like Castle Dynamic Proxy.
Clay, that is used in Orchard http://clay.codeplex.com/ And here is an example and description http://weblogs.asp.net/bleroy/archive/2010/08/18/clay-malleable-c-dynamic-objects-part-2.aspx
精彩评论