1 -------------------------------------------------------------------------------
3 -------------------------------------------------------------------------------
5 -------------------------------------------------------------------------------
7 -------------------------------------------------------------------------------
13 => where { Encode::is_utf8( $_[0] ) or $_[0] !~ m/[^0x00-0x7F]/x }
14 => optimize_as { defined($_[0]) && !ref($_[0]) };
18 => where { !Encode::is_utf8( $_[0] ) }
19 => optimize_as { defined($_[0]) && !ref($_[0]) };
22 - should handle some moose-specific options in &Moose::Meta::Class::create
23 things like roles, and method modifiers (although those can probably be
28 Add support for doing it with Classes which do not have
29 a type constraint yet created
35 - inherited slot specs
37 'does' can be added to,.. but not changed
38 (need type unions for this)
42 a proxied attribute is an attribute
43 which looks like an attribute,
44 talks like an attribute, smells
45 like an attribute,.. but if you
46 look behind the curtain,.. its
47 over there.. in that other object
49 (... probably be a custom metaclass)
51 - subtype $anon_subtype => where { ... }
53 [22:56] stevan sub mst_doesnt_like_to_type { (shift)->meta->attr->type_contstraint }
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,
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
74 [23:00] mst should be all you need to change
76 [23:01] stevan so you can then say
77 [23:01] stevan subtype $anon => where { ... };
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
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)
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 { ... };
110 -------------------------------------------------------------------------------
112 -------------------------------------------------------------------------------
114 - Moose "strict" mode
116 use Moose 'strict'; This would allow us to have all sort of expensive tests
117 which can be turned off in prod.
119 - Moose::Philosophy.pod
121 To explain Moose from a very high level
125 We certainly have enough meta-information to make pretty complete POD docs.