On May 4, 2006, at 9:35 AM, John Lam wrote:

> Hi Dave,
>
> Duck typing for attributes - cool idea, but I worry about it  
> because of the
> difficulty (impossibility) in telling read-only properties from  
> ordinary
> methods:
>
> module Utilities
>  def format_disk
>  end
> end
>
> class Person
>  include Utilities
>  def first_name
>  end
> end
>
> You see my interest in this topic is driven entirely around my  
> ability to
> add some runtime magic in my marshaler. Since the metadata doesn't  
> exist in
> Ruby, I have to rely on some kind of convention. I might need to  
> add that
> convention via a mixin that you can write that serves as an adapter  
> between
> the type that you want to make data-bindable in .NET. So you could  
> patch
> ActiveRecord in a RubyCLR app via:
>
> class ActiveRecord
>  include RubyClr::MakeBindable
> end
>
> This removes the hard-coded depenency on ActiveRecord from my  
> marshaler.
>
> Does this sound reasonable?
>
> Thanks
> -John
> http://www.iunknown.com
>

I personally would much rather have RubyClr::MakeBindable then have  
it try to 'guess'.