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