How will you use the C# 4 dynamic type?

后端 未结 6 1813
余生分开走
余生分开走 2020-12-29 05:33

C# 4 will contain a new dynamic keyword that will bring dynamic language features into C#.

How do you plan to use it in your own code, what pattern woul

6条回答
  •  醉话见心
    2020-12-29 06:11

    Miguel de Icaza presented a very cool use case on his blog, here (source included):

    dynamic d = new PInvoke ("libc");
    d.printf ("I have been clicked %d times", times);
    

    If it is possible to do this in a safe and reliable way, that would be awesome for native code interop.

提交回复
热议问题