also accept hash refs to new_object and friends
[gitmo/Moose.git] / TODO
CommitLineData
8b59f8d6 1-------------------------------------------------------------------------------
43d599e5 2 BUGS
3-------------------------------------------------------------------------------
43d599e5 4
5-------------------------------------------------------------------------------
8b59f8d6 6TODO
7-------------------------------------------------------------------------------
8
d4967760 9- DDuncan's Str types
10
11subtype 'Str'
12 => as 'Value'
13 => where { Encode::is_utf8( $_[0] ) or $_[0] !~ m/[^0x00-0x7F]/x }
14 => optimize_as { defined($_[0]) && !ref($_[0]) };
15
16subtype 'Blob'
17 => as 'Value'
18 => where { !Encode::is_utf8( $_[0] ) }
19 => optimize_as { defined($_[0]) && !ref($_[0]) };
20
21
715ea0b7 22- should handle some moose-specific options in &Moose::Meta::Class::create
23 things like roles, and method modifiers (although those can probably be
24 ignored if i want to)
25
8b59f8d6 26- type unions
27
28Add support for doing it with Classes which do not have
29a type constraint yet created
30
31- type intersections
32
33Mostly just for Roles
34
35- inherited slot specs
36
db1ab48d 37'does' can be added to,.. but not changed
38(need type unions for this)
8b59f8d6 39
8b59f8d6 40- proxy attributes
41
db1ab48d 42a proxied attribute is an attribute
43which looks like an attribute,
44talks like an attribute, smells
45like an attribute,.. but if you
46look behind the curtain,.. its
47over there.. in that other object
48
49(... probably be a custom metaclass)
8b59f8d6 50
8a157bab 51- subtype $anon_subtype => where { ... }
52
53[22:56] stevan sub mst_doesnt_like_to_type { (shift)->meta->attr->type_contstraint }
54[22:57] mst err
55[22:57] stevan :P
56[22:57] stevan are you wanting to reuse it or something?
57[22:57] stevan my $subtype = subtype 'Something' => where { ... };
58[22:58] stevan then you can do isa => $subtype
59[22:58] mst but I can't subtype it again
60[22:59] stevan mst: ahhh...
61[22:59] mst well, I can. but it suddenly gets very "long way round" ish
62[23:00] stevan my $constraint = Moose::Meta::TypeConstraint->new(
63[23:00] stevan name => $name || '__ANON__',
64[23:00] stevan parent => $parent,
65[23:00] stevan constraint => $check,
66[23:00] stevan message => $message,
67[23:00] stevan );
68[23:00] stevan yeah thats kinda the long way
69[23:00] stevan mst: what would you like it to be?
70[23:00] mst $parent = find_type_constraint($parent) if defined $parent;
71[23:00] mst if $parent is already a type constraint
72[23:00] mst skip that bit
73[23:00] stevan hmm
74[23:00] mst should be all you need to change
75[23:00] stevan yeah
76[23:01] stevan so you can then say
77[23:01] stevan subtype $anon => where { ... };
78[23:01] mst right
79[23:01] stevan ok
80
f90e052d 81- local coerce
82
83[13:16] mst stevan: slight problem with coerce
84[13:16] mst I only get to declare it once
85[13:17] mst so if I'm trying to declare it cast-style per-source-class rather than per-target-class
86[13:17] mst I am extremely screwed
87[13:17] stevan yes
88[13:17] stevan they are not class specific
89[13:18] stevan they are attached to the type constraint itself
90[13:18] * stevan ponders anon-coercion-metaobjects
91[13:18] mst yes, that's fine
92[13:19] mst but when I declare a class
93[13:19] mst I want to be able to say "this class coerces to X type via <this>"
94[13:19] stevan yeah something like that
95[13:19] stevan oh,.. hmm
96[13:20] stevan sort of like inflate/deflate?
97[13:20] stevan around the accessors?
98[13:25] * bluefeet has quit (Remote host closed the connection)
99[13:27] mst no
100[13:27] mst nothing like that
101[13:27] mst like a cast
102[13:31] mst stevan: $obj->foo($bar); where 'foo' expects a 'Foo' object
103[13:31] mst stevan: is effectively <Foo>$bar, right?
104[13:32] mst stevan: I want to be able to say in package Bar
105[13:32] mst stevan: coerce_to 'Foo' via { ... };
106[13:32] mst etc.
107[13:53] stevan hmm
108
109
8b59f8d6 110-------------------------------------------------------------------------------
111TO PONDER
112-------------------------------------------------------------------------------
113
114- Moose "strict" mode
115
116use Moose 'strict'; This would allow us to have all sort of expensive tests
117which can be turned off in prod.
118
119- Moose::Philosophy.pod
120
121To explain Moose from a very high level
122
687e52bb 123- moosedoc
8b59f8d6 124
687e52bb 125We certainly have enough meta-information to make pretty complete POD docs.
8b59f8d6 126
127
8245db56 128