<rant> On Tue, 27 Mar 2001, Benjamin J. Tilly wrote: > - Perl's tie is being done in Ruby - right. In Perl there is > a basic syntactic wall between dealing with an object as an > object and dealing with it as a drop-in replacement for a > native data-type. Ruby's syntax makes this a non-issue. Well, I haven't seen the "tie" feature in Ruby. You can't just call Ruby's syntax an implementation of "tie". In Ruby there is a basic public relations wall between dealing with an object as an object and dealing with it as a drop-in replacement for a native data-type. The Ruby community's standard lie is that you only have to define #[] and #[]=. This is from the people who have never really considered doing so. To implement those two methods you need to work out negative indices, slice by length (with negative indices), slice by range (with negative indices bypassing the semantics of range), expanding array with default value 'nil', handling out-of-bounds fetching, and if you are implementing String, you also have to handle slice by string and slice by regexp. And you have to raise errors when you need to. By the time you succeed you have filled a few pages, and that's only 2 methods. Perl's "tie" is by all standards a hack. However, from a user's point of view, it _works_, and as an idea it _works too_. This is why I have written MetaRuby in the first place: to bring that idea to Ruby. And this is also why I am rejecting any requests to make MetaRuby "less like Perl". But one thing MetaRuby can't do yet is make the delusions go away. I plan to add that feature around version 1.618034, and clearly I'm not there yet. </rant> matju