From: gabriele renzi Date: 2005-09-09T04:56:29+09:00 Subject: Re: Lexical Casts with Ruby Eric Mahurin ha scritto: >>>If this is a good solution for you, maybe an RCR for this >> >>more >> >>>general conversion mechanism is in order. >> >>See RCR#280. The implementation is 34 lines long. > > > Don't know why I missed that one. I don't really like the > implementation with the global (or rather class variable) hash. > I would rather see an encapsulated API - each class gives > methods for converting to/from objects of other classes of > interest (i.e. String). The reason for the global transformation table is basically being able to handle any kind of "type" not just Classes. I like to think of ruby as object based more than Class based. Anyway, even if your approach is more conservative, I'd appreciate if it was blessed[1]. I wonder what matz think of this stuff. [1] what I'd really like to see is multimethods. Just specialize #new and everything goes fine ;)