title: Binder vs DynamicMetaObject & DynamicMetaObject caching
body: <p><strong>Where should dynamic binding logic be placed when developing new language with DLR?</strong> </p>
  
  <p>As far as I know, there are two possible places to implement late binding. One is in binder and the other is in DynamicMetaObject subclass. </p>
  
  <p>My current implementation uses binders only to identify type of operation, to cary some custom data and to throw exception in fallback method. Actual binding is done in DynamicMetaObject. </p>
  
  <p>Is there a suggestion for what goes where in DLR world? </p>
  
  <p><strong>When to create DynamicMetaObject?</strong></p>
  
  <p>Every impelmentation of <code>IDynamicMetaObjectProvider</code> that I've seen every time when binding is needed creates new instance of DynamicMetaObject subclass and returns it. This seem a bit odd to me. For example, I have wrapper around Int32 in my language and when I execute something like this:</p>
  
  <pre><code>1+1
  1+1
  </code></pre>
  
  <p>there are 6 new DynamicMetaObjects created - one for each operand and one for each result. In my case, there is only one instance of int with same value (in this example, only one instance of wrapper around int with value 1), so it doesn't seem right to have 4 instances of DynamicMetaObject. </p>
  
  <p>Is there a way to use same <code>DynamicMetaObject</code> for the same instance always? I tried to create DynamicMetaObject once and then return same instance in <code>GetMetaObject</code> method, but all i got was an error <code>An IDynamicMetaObjectProvider created invalid DynamicMetaObject instance.</code></p>
  
  <p>Also, BindingRestriction parameter in DynamicMetaObject constructor doesn't seem to have effect when creating subclass (I hoped that DLR will cache instance of DynamicMetaObject based on binding restrictions).  Is there a way to cache MO for instance (or, idealy for type)?</p>