Larry Wall <[EMAIL PROTECTED]> writes: > On Tue, Jul 20, 2004 at 11:00:39PM -0700, chromatic wrote: > : On Tue, 2004-07-20 at 19:35, Luke Palmer wrote: > : > : > The New Way (tm) to do that would probably be sticking a role onto the > : > array object with which you're dealing: > : > > : > my @foo does separator('//') = (1,2,3,4,5); > : > say "[EMAIL PROTECTED]"; # 1//2//3//4//5 > : > : Shh, no one's let slip the idea of curried roles yet! I'm not even > : certain A12 mentioned parametric roles, let alone first-class roles. > > Well, A12 did talk about parametric roles, but I glossed over the > first-class roles a bit. I didn't want to scare people with > > $foo does $bar > > though, of course, there's no reason in principle you shouldn't be able > to do that as a run-time operation. You just can't instantiate a role > object. The murky area in the middle is, of course, how you specify > an initial value aimed at the attributes of a particular role without > creating a "real" object containing just those values. Passing around > lists of pairs is probably good enough for that, as long as you can > keep straight which list of pairs is intended to initialize which > roles.
I really hope you change your mind about this; the sooner I can get that wild and crazy list of pairs nicely stashed in their appropriate role objects, the happier I'll be about the resilience of my code.