I read this article about Dynamic Objects in C # 4.0 .In this example, the second argument to the TryGetMember function (GetMemberBinder binder, out result result) is of type Object. I looked at MSDN and noticed that other methods also get arguments like Object. Why are these functions not common?From MSDN
For simple assignments, boxing and unpacking are computationally expensive processes
If boxing / unpacking is expensive, isn't it better to use generics?
Thank.
" ". , , .
, , :)
TryGetMember , , , . , , . :
TryGetMember
dynamic foo = GetDynamicValueFromSomewhere(); Console.WriteLine(foo.SomeProperty);
, Console.WriteLine SomeProperty . "" ... ?
Console.WriteLine
SomeProperty
, object CLR. :
object
dynamic x = 10;
. " " CLR. ( ?)