[Ironruby-core] Friday Status Update

Charles Oliver Nutter charles.nutter at sun.com
Sat May 3 04:04:49 EDT 2008


Peter Bacon Darwin wrote:
> I might be right off track here and since I haven't seen any of the detailed
> discussion about the question below I might be being completely naive.
> 
> The open question should really be targeting all standard conversion
> protocols in Ruby.
> 
> In my mind it seems that the way Ruby works generally is to have a load of
> these "protocols" for type conversion, but that it is not enforced by the
> language at all and that it is entirely up the library developer to follow
> suit.  While this allows ultimate freedom for the developer it obviously
> does allow inconsistency to creep in.
> I would feel uncomfortable baking these protocols into the binder, unless
> there was some way of overriding them in library code, since this is
> perfectly possible in MRI.  For instance, it must be possible in at least
> some cases to monkey patch code that by default uses the standard conversion
> protocol so that it does something different (e.g. converts strings to
> symbols in some other way???)
> 
> Clearly this is not a good thing to do in general but since Ruby allows it
> as a language, it seems that it should be supported in IronRuby.

FYI, there are a few cases in the core classes that use e.g to_s or to_a
instead of to_str or to_ary to coerce. I don't remember them off the top 
of my head.

- Charlie


More information about the Ironruby-core mailing list