conflict
[gitmo/Moose.git] / TODO
CommitLineData
85910734 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
14If the $meta is a class, we apply the roles to the class. If it's a role, we
15hold onto them and apply them as part of applying the role to a class.
16
17To make this all work nicely, we'll probably want to track the original role
18where a method was defined, just like we do with attributes currently. We'll
19also need to store method modifiers with their original role, which may mean
20adding some sort of Moose::Meta::Role::MethodModifier class.
21
22For each role-specific thing (methods, attributes, etc.) we should allow a
23role_attribute, role_method, etc. key. The common case will be that the
24metaroles are intended for the consuming class, but we should allow for
25metaroles on the role's metaobjects as well.
26
27=== Remove a bunch of deprecated crap
28
29See Moose::Manual::Delta for a list. Some of this is important to make merging
30Class::MOP into Moose core much easier. Other is just removing complexity
31needed to support ancient APIs.
32
33== Old todo (does anyone look at this?)
34
8b59f8d6 35-------------------------------------------------------------------------------
7af2c1d2 36BUGS
d03bd989 37-------------------------------------------------------------------------------
43d599e5 38
39-------------------------------------------------------------------------------
7af2c1d2 40FEATURES
8b59f8d6 41-------------------------------------------------------------------------------
42
d4967760 43- DDuncan's Str types
44
d03bd989 45subtype 'Str'
46 => as 'Value'
47 => where { Encode::is_utf8( $_[0] ) or $_[0] !~ m/[^0x00-0x7F]/x }
d4967760 48 => optimize_as { defined($_[0]) && !ref($_[0]) };
49
d03bd989 50subtype 'Blob'
51 => as 'Value'
52 => where { !Encode::is_utf8( $_[0] ) }
d4967760 53 => optimize_as { defined($_[0]) && !ref($_[0]) };
54
8b59f8d6 55- type unions
56
d03bd989 57Add support for doing it with Classes which do not have
8b59f8d6 58a type constraint yet created
59
60- type intersections
61
62Mostly just for Roles
63
64- inherited slot specs
65
db1ab48d 66'does' can be added to,.. but not changed
67(need type unions for this)
8b59f8d6 68
8b59f8d6 69- proxy attributes
70
db1ab48d 71a proxied attribute is an attribute
d03bd989 72which looks like an attribute,
73talks like an attribute, smells
74like an attribute,.. but if you
75look behind the curtain,.. its
db1ab48d 76over there.. in that other object
77
78(... probably be a custom metaclass)
8b59f8d6 79
f90e052d 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
d03bd989 87[13:17] stevan they are not class specific
f90e052d 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.
d03bd989 106[13:53] stevan hmm
107
7af2c1d2 108-------------------------------------------------------------------------------
109INTERNALS
110-------------------------------------------------------------------------------
111
112- rationalize all the get_X methods for classes (and roles)
113
114We have get_attribute, get_attributes_list, get_all_attributes,
115etc. First, we need to make the method names consistent. If something
116returns an attribute vs a name, that needs to be clear from the method
117name. We also need to make sure that local vs. "entire inheritance
118chain" is clear from the name.
119
7af2c1d2 120This is mostly a CMOP change.
121
122- Metaclass constructors
123
124There'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
7af2c1d2 130- Moose::Meta::TypeConstraint::Parameter{izable,ized}
131
132The relationship between these two classes is very odd. In particular,
133this line in Parameterized is insane:
134
135 foreach my $type (Moose::Util::TypeConstraints::get_all_parameterizable_types()) {
136
137Why does it need to loop through all parameterizable types? Shouldn't
138it know which parameterizable type it "came from"?
139
140- Moose::Util::TypeConstraints vs Moose::Meta::Type{Coercion,Constraint}
141
142The Util module has _way_ too much functionality. It needs to be
143refactored so it's a thin sugar layer on top of the meta API. As it
144stands now, it does things like parse type names (and determine if
145they're valid), manage the registry, and much more.
146
7af2c1d2 147- Anything with a _(meta)?class method
148
149Every method that returns a class name needs to become a rw attribute
150that can be set via the constructor.
d03bd989 151
cac484fa 152- The Moose::Error stuff
153
154This is sort of half-implemented. We still use Carp directly, and the
155internals can't decide how to throw an error (is it
156Moose->throw_error, __PACKAGE__->throw_error, what?).
157
158The internals need to be made consistent before we expose this to the
159rest of the world.
160
8b59f8d6 161-------------------------------------------------------------------------------
162TO PONDER
163-------------------------------------------------------------------------------
164
165- Moose "strict" mode
166
167use Moose 'strict'; This would allow us to have all sort of expensive tests
d03bd989 168which can be turned off in prod.
169
8b59f8d6 170- Moose::Philosophy.pod
171
172To explain Moose from a very high level
173
687e52bb 174- moosedoc
8b59f8d6 175
687e52bb 176We certainly have enough meta-information to make pretty complete POD docs.
d03bd989 177
178
179