On Mon, Jul 19, 2004 at 07:40:01PM -0500, Rod Adams wrote: : TMTOWTDI can apply here, I believe. You give me my way, I'll give you : yours. Leave me open with all my parameters, and you can have your list : of file abstraction classes. I could see having those classes part of : core, if there's enough support for them, and then something simple like : "use Files;" to turn them on.
The reality will be somewhere in the middle--or maybe it's off to one side or the other. I don't think anyone in this discussion (including me) has a complete grasp of how roles will change the way OO is done in Perl 6. When you open a filehandle, or create a string, or something in between, you're just making an object with various capabilities. With roles, you don't even necessarily have to specify a particular class to construct. You can view an "open" statement as a request for an object that fulfills certain roles, and let Perl search for and/or compose an appropriate class. You don't have to care about some artificial, predefined OO hierarchy because roles do an end run around the use of subclassing for a task that subclassing isn't good for. File handles are a classic case of "the god object" syndrome. With roles, I think we can have our OO cake, and maybe even bear to eat it too. Larry