cb003ada760916abb9f3e110bc38a750863417e7
[gitmo/Moose.git] / TODO
1 == Todo for 2.0200
2
3 === Revise MetaRole API to reunify class/role metaroles:
4
5   apply_metaroles(
6       for   => $meta,
7       roles => {
8           attribute => [...],
9           class     => [...],
10           role_attribute => [ ... ],
11       }
12   );
13
14 If the $meta is a class, we apply the roles to the class. If it's a role, we
15 hold onto them and apply them as part of applying the role to a class.
16
17 To make this all work nicely, we'll probably want to track the original role
18 where a method was defined, just like we do with attributes currently. We'll
19 also need to store method modifiers with their original role, which may mean
20 adding some sort of Moose::Meta::Role::MethodModifier class.
21
22 For each role-specific thing (methods, attributes, etc.) we should allow a
23 role_attribute, role_method, etc. key. The common case will be that the
24 metaroles are intended for the consuming class, but we should allow for
25 metaroles on the role's metaobjects as well.
26
27 === Remove a bunch of deprecated crap
28
29 See Moose::Manual::Delta for a list. Some of this is important to make merging
30 Class::MOP into Moose core much easier. Other is just removing complexity
31 needed to support ancient APIs.
32
33 == Old todo (does anyone look at this?)
34
35 -------------------------------------------------------------------------------
36 BUGS
37 -------------------------------------------------------------------------------
38
39 -------------------------------------------------------------------------------
40 FEATURES
41 -------------------------------------------------------------------------------
42
43 - DDuncan's Str types
44
45 subtype 'Str'
46     => as 'Value'
47     => where { Encode::is_utf8( $_[0] ) or $_[0] !~ m/[^0x00-0x7F]/x }
48     => optimize_as { defined($_[0]) && !ref($_[0]) };
49
50 subtype 'Blob'
51     => as 'Value'
52     => where { !Encode::is_utf8( $_[0] ) }
53     => optimize_as { defined($_[0]) && !ref($_[0]) };
54
55 - type unions
56
57 Add support for doing it with Classes which do not have
58 a type constraint yet created
59
60 - type intersections
61
62 Mostly just for Roles
63
64 - inherited slot specs
65
66 'does' can be added to,.. but not changed
67 (need type unions for this)
68
69 - proxy attributes
70
71 a proxied attribute is an attribute
72 which looks like an attribute,
73 talks like an attribute, smells
74 like an attribute,.. but if you
75 look behind the curtain,.. its
76 over there.. in that other object
77
78 (... probably be a custom metaclass)
79
80 - local coerce
81
82 [13:16]         mst     stevan: slight problem with coerce
83 [13:16]         mst     I only get to declare it once
84 [13:17]         mst     so if I'm trying to declare it cast-style per-source-class rather than per-target-class
85 [13:17]         mst     I am extremely screwed
86 [13:17]         stevan  yes
87 [13:17]         stevan  they are not class specific
88 [13:18]         stevan  they are attached to the type constraint itself
89 [13:18]         *       stevan ponders anon-coercion-metaobjects
90 [13:18]         mst     yes, that's fine
91 [13:19]         mst     but when I declare a class
92 [13:19]         mst     I want to be able to say "this class coerces to X type via <this>"
93 [13:19]         stevan  yeah something like that
94 [13:19]         stevan  oh,.. hmm
95 [13:20]         stevan  sort of like inflate/deflate?
96 [13:20]         stevan  around the accessors?
97 [13:25]         *       bluefeet has quit (Remote host closed the connection)
98 [13:27]         mst     no
99 [13:27]         mst     nothing like that
100 [13:27]         mst     like a cast
101 [13:31]         mst     stevan: $obj->foo($bar); where 'foo' expects a 'Foo' object
102 [13:31]         mst     stevan: is effectively <Foo>$bar, right?
103 [13:32]         mst     stevan: I want to be able to say in package Bar
104 [13:32]         mst     stevan: coerce_to 'Foo' via { ... };
105 [13:32]         mst     etc.
106 [13:53]         stevan  hmm
107
108 -------------------------------------------------------------------------------
109 INTERNALS
110 -------------------------------------------------------------------------------
111
112 - rationalize all the get_X methods for classes (and roles)
113
114 We have get_attribute, get_attributes_list, get_all_attributes,
115 etc. First, we need to make the method names consistent. If something
116 returns an attribute vs a name, that needs to be clear from the method
117 name. We also need to make sure that local vs. "entire inheritance
118 chain" is clear from the name.
119
120 This is mostly a CMOP change.
121
122 - Metaclass constructors
123
124 There's a _lot_ of different conventions in here. Some things to consider:
125
126 * new vs _new
127 * allowing new( 'name', %args ) vs ( name => 'name', %args )
128 * Method->wrap vs Method->new
129
130 - Role & Class
131
132 These two share a _lot_ of logic, but it's not via shared code. Maybe
133 implement some sort of role-lit internal thing so we can have a
134 "HasAttributes" and "HasMethods" role for classes and roles.
135
136 - Moose::Meta::TypeConstraint::Parameter{izable,ized}
137
138 The relationship between these two classes is very odd. In particular,
139 this line in Parameterized is insane:
140
141     foreach my $type (Moose::Util::TypeConstraints::get_all_parameterizable_types()) {
142
143 Why does it need to loop through all parameterizable types? Shouldn't
144 it know which parameterizable type it "came from"?
145
146 - Moose::Util::TypeConstraints vs Moose::Meta::Type{Coercion,Constraint}
147
148 The Util module has _way_ too much functionality. It needs to be
149 refactored so it's a thin sugar layer on top of the meta API. As it
150 stands now, it does things like parse type names (and determine if
151 they're valid), manage the registry, and much more.
152
153 - Anything with a _(meta)?class method
154
155 Every method that returns a class name needs to become a rw attribute
156 that can be set via the constructor.
157
158 - The Moose::Error stuff
159
160 This is sort of half-implemented. We still use Carp directly, and the
161 internals can't decide how to throw an error (is it
162 Moose->throw_error, __PACKAGE__->throw_error, what?).
163
164 The internals need to be made consistent before we expose this to the
165 rest of the world.
166
167 -------------------------------------------------------------------------------
168 TO PONDER
169 -------------------------------------------------------------------------------
170
171 - Moose "strict" mode
172
173 use Moose 'strict'; This would allow us to have all sort of expensive tests
174 which can be turned off in prod.
175
176 - Moose::Philosophy.pod
177
178 To explain Moose from a very high level
179
180 - moosedoc
181
182 We certainly have enough meta-information to make pretty complete POD docs.
183
184
185