4d90ee81c2c7eb1e4b9171c30f83bf68507b173e
[gitmo/Moose.git] / TODO
1 -------------------------------------------------------------------------------
2  BUGS
3 ------------------------------------------------------------------------------- 
4  
5 mst: if I do "subtype 'Foo' => as 'Bar';" I get an empty condition and it dies
6
7 -------------------------------------------------------------------------------
8 TODO
9 -------------------------------------------------------------------------------
10
11 - should handle some moose-specific options in &Moose::Meta::Class::create
12   things like roles, and method modifiers (although those can probably be 
13   ignored if i want to)
14
15 - type unions
16
17 Add support for doing it with Classes which do not have 
18 a type constraint yet created
19
20 - type intersections
21
22 Mostly just for Roles
23
24 - inherited slot specs
25
26 'does' can be added to,.. but not changed
27 (need type unions for this)
28
29 - proxy attributes
30
31 a proxied attribute is an attribute
32 which looks like an attribute, 
33 talks like an attribute, smells 
34 like an attribute,.. but if you 
35 look behind the curtain,.. its 
36 over there.. in that other object
37
38 (... probably be a custom metaclass)
39
40 - compile time extends
41
42 [00:39]         sri         but maybe a better syntax for compile time extends
43 [00:39]         stevan  I have been pondering that actually
44 [00:39]         sri         use Moose extends => Foo::Bar
45 [00:40]         stevan  I think now that we have the Sub::Exporter stuff 
46                     in, that kinda thing should be pretty easy
47
48 nothingmuch notes that all the constructs should be supported in the entirety of the use clause:
49
50     use Moose (
51         has => foo (
52             ....
53         ),
54     );
55
56 and that if this usage style is used nothing is exported to the namespace.
57
58 - default should dclone()
59
60 - subtype $anon_subtype => where { ... }
61
62 [22:56]         stevan  sub mst_doesnt_like_to_type { (shift)->meta->attr->type_contstraint }
63 [22:57]         mst     err
64 [22:57]         stevan  :P
65 [22:57]         stevan  are you wanting to reuse it or something?
66 [22:57]         stevan  my $subtype = subtype 'Something' => where { ... };
67 [22:58]         stevan  then you can do isa => $subtype 
68 [22:58]         mst     but I can't subtype it again
69 [22:59]         stevan  mst: ahhh... 
70 [22:59]         mst     well, I can. but it suddenly gets very "long way round" ish
71 [23:00]         stevan  my $constraint = Moose::Meta::TypeConstraint->new(
72 [23:00]         stevan              name       => $name || '__ANON__',
73 [23:00]         stevan              parent     => $parent,            
74 [23:00]         stevan              constraint => $check,       
75 [23:00]         stevan              message    => $message,    
76 [23:00]         stevan          );
77 [23:00]         stevan  yeah thats kinda the long way
78 [23:00]         stevan  mst: what would you like it to be?
79 [23:00]         mst     $parent = find_type_constraint($parent) if defined $parent;
80 [23:00]         mst     if $parent is already a type constraint
81 [23:00]         mst     skip that bit
82 [23:00]         stevan  hmm
83 [23:00]         mst     should be all you need to change
84 [23:00]         stevan  yeah
85 [23:01]         stevan  so you can then say 
86 [23:01]         stevan  subtype $anon => where { ... };
87 [23:01]         mst     right
88 [23:01]         stevan  ok
89
90 - method keyword
91
92 [23:37]         mst     more seriously, I'd still like a "method" keyword or something
93 [23:37]         mst     method 'foo' => sub { ... };
94 [23:38]         stevan  what would it do more than sub foo { ... }?
95 [23:39]         stevan  I would like multimethods actually
96 [23:39]         mst     almost exactly nothing, to begin with
97 [23:39]         stevan  but thats just cause I love CLOS and am reading a book on Dylan now
98 [23:40]         stevan  keyword squating :)
99 [23:40]         mst     but if we need to hook stuff later it's bloody handy to already have people writing it that way
100 [23:40]         mst     right
101 ...
102 [23:49]         mst     oh, also: method 'has' => sub { ... } could squelch the redefine warning
103   
104 - local coerce
105
106 [13:16]         mst     stevan: slight problem with coerce
107 [13:16]         mst     I only get to declare it once
108 [13:17]         mst     so if I'm trying to declare it cast-style per-source-class rather than per-target-class
109 [13:17]         mst     I am extremely screwed
110 [13:17]         stevan  yes
111 [13:17]         stevan  they are not class specific 
112 [13:18]         stevan  they are attached to the type constraint itself
113 [13:18]         *       stevan ponders anon-coercion-metaobjects
114 [13:18]         mst     yes, that's fine
115 [13:19]         mst     but when I declare a class
116 [13:19]         mst     I want to be able to say "this class coerces to X type via <this>"
117 [13:19]         stevan  yeah something like that
118 [13:19]         stevan  oh,.. hmm
119 [13:20]         stevan  sort of like inflate/deflate?
120 [13:20]         stevan  around the accessors?
121 [13:25]         *       bluefeet has quit (Remote host closed the connection)
122 [13:27]         mst     no
123 [13:27]         mst     nothing like that
124 [13:27]         mst     like a cast
125 [13:31]         mst     stevan: $obj->foo($bar); where 'foo' expects a 'Foo' object
126 [13:31]         mst     stevan: is effectively <Foo>$bar, right?
127 [13:32]         mst     stevan: I want to be able to say in package Bar
128 [13:32]         mst     stevan: coerce_to 'Foo' via { ... };
129 [13:32]         mst     etc.
130 [13:53]         stevan  hmm  
131   
132   
133 -------------------------------------------------------------------------------
134 TO PONDER
135 -------------------------------------------------------------------------------
136
137 - Moose "strict" mode
138
139 use Moose 'strict'; This would allow us to have all sort of expensive tests
140 which can be turned off in prod.     
141         
142 - Moose::Philosophy.pod
143
144 To explain Moose from a very high level
145
146 - moosedoc
147
148 We certainly have enough meta-information to make pretty complete POD docs.
149         
150         
151