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