From: Rodrigo Rosenfeld Rosas Date: 2011-01-20T09:14:57+09:00 Subject: [ruby-core:34631] Re: [Ruby 1.9-Feature#4264] General type coercion protocol for Ruby Em 19-01-2011 19:53, Charles Oliver Nutter escreveu: > On Wed, Jan 19, 2011 at 5:54 AM, Rodrigo Rosenfeld Rosas > wrote: >> I like the cast_to/cast_from names and I guess it avoids conflict with most >> libraries. > They're not bad, but casting to me means something altogether > different: treating a an object as a different type, while still > referencing the same object. > > I don't know what "cast" means generally in language design/type > theory, but it seems wrong for what's happening here. In our case, > we're asking the object to convert itself to a specific type...not > casting it to a type it already implements. > > Perhaps convert_to and convert_from would be more in line with what's happening? > > - Charlie convert_to/from is ok to me too. Does someone else object this name? Rodrigo