Todd,
Not really design issues so much as it is just not a simple task. We have long pondered a
requires_attr of some kind but figuring out exactly how it would work is the tricky part. For
instance, if you specify a type constraint in your requirement, something like:
requires_attr 'foo' => (isa => 'ArrayRef');
should you have to supply *exactly* that type constraint? or would a subtype of that
constraint do?
The same goes for all the other options available during attribute construction, and gets
even more complex when you try to figure out how to support some of the MooseX::
extensions in a meaningful way.
I think at this point there are more important items to work on, such as a general refactor of
the type system guts, startup time speed improvements and a cleaner inline method
generation system. However, that does not mean that patches are not welcome. I think I
would prefer to discuss details on the mailing list first so as to get all the edge cases and
issues out in the open.
Thanks,
- Stevan
On Wed Mar 11 18:40:45 2009, todd_rinaldo wrote:
Show quoted text> I am using roles in Moose. I noticed an error message trying to require
> an attribute from another class saying requires does not support
> attributes.
>
> This would be a useful feature to support. Are there design issues that
> make this a dificult problem to solve?