On 4/20/04 1:25 AM, Luke Palmer wrote: > John Siracusa writes: >> The "will STORE" stuff covers the easy cases, but can I extend it all the >> way up to a name() that's a multimethod with a ton of optional args? I >> supposed you can (technically) do all of that with "will STORE", but it >> seems an odd place for what would more naturally be code in the name() >> method itself. > > I think a role on the attribute is not the right place to put it. What > you're doing is returning a proxy object that knows how to set both the > name and the gender.
That's a bit too "example-specific." Really what I was getting at was arbitrary, simple extensibility to do "anything" in response to $obj.foo (with and without args) down the road, not just to do the specific thing that I described in my example. With a "boring" Perl 5 style get/set accessor API, I can just rewrite method foo { } until the cows come home. I find that a lot more straight-forward than the role playing you describe, but YMMV :) -John