How does the is
operator work with respect to the DLR?
To make my question a little more explicit, consider the following signature:
public bool Is<T>(Func<dynamic> getInstance)
{
return getInstance() is T;
}
By default, what conditions are necessary for Is<T>
to return true
? Furthermore, does the DLR provide any mechanism to customize this behavior?
public interface INamed { string Name { get; } }
and when I checkgetInstance() is INamed
to have my customDynamicMetaObject
implementation return true iff the dynamic object contains a string property named "Name". Any suggestions? – Agnolaa is B
<=>typeof(B).IsAssignableFrom(a.GetType())
– Ropyis
syntax to those checks? – Agnolaa == null
– AgnolaT
type. Do you see a problem here? – AgnolaIMyInterface myInterface = Impromptu.ActLike(expando)
. Dynamic Implementation static interface. – Boozeimpromptu
before, but haven't used it. Does it support what I'm describing out of the box? – Agnola