[Moose-commits] r7305 - in Class-MOP/branches/method_generation_cleanup: . lib lib/Class lib/Class/MOP lib/Class/MOP/Method t t/lib

autarch at code2.0beta.co.uk autarch at code2.0beta.co.uk
Wed Jan 14 08:46:13 GMT 2009


Author: autarch
Date: 2009-01-14 00:46:12 -0800 (Wed, 14 Jan 2009)
New Revision: 7305

Added:
   Class-MOP/branches/method_generation_cleanup/t/306_is_class_loaded.t
   Class-MOP/branches/method_generation_cleanup/t/header_pp.inc
   Class-MOP/branches/method_generation_cleanup/t/lib/TestClassLoaded.pm
Modified:
   Class-MOP/branches/method_generation_cleanup/
   Class-MOP/branches/method_generation_cleanup/Changes
   Class-MOP/branches/method_generation_cleanup/MOP.xs
   Class-MOP/branches/method_generation_cleanup/Makefile.PL
   Class-MOP/branches/method_generation_cleanup/README
   Class-MOP/branches/method_generation_cleanup/lib/Class/MOP.pm
   Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Attribute.pm
   Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Class.pm
   Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Immutable.pm
   Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Instance.pm
   Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Method.pm
   Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Method/Accessor.pm
   Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Method/Constructor.pm
   Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Method/Generated.pm
   Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Method/Wrapped.pm
   Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Module.pm
   Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Object.pm
   Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Package.pm
   Class-MOP/branches/method_generation_cleanup/lib/metaclass.pm
   Class-MOP/branches/method_generation_cleanup/t/000_load.t
   Class-MOP/branches/method_generation_cleanup/t/001_basic.t
   Class-MOP/branches/method_generation_cleanup/t/002_class_precedence_list.t
   Class-MOP/branches/method_generation_cleanup/t/003_methods.t
   Class-MOP/branches/method_generation_cleanup/t/004_advanced_methods.t
   Class-MOP/branches/method_generation_cleanup/t/005_attributes.t
   Class-MOP/branches/method_generation_cleanup/t/006_new_and_clone_metaclasses.t
   Class-MOP/branches/method_generation_cleanup/t/010_self_introspection.t
   Class-MOP/branches/method_generation_cleanup/t/011_create_class.t
   Class-MOP/branches/method_generation_cleanup/t/012_package_variables.t
   Class-MOP/branches/method_generation_cleanup/t/013_add_attribute_alternate.t
   Class-MOP/branches/method_generation_cleanup/t/014_attribute_introspection.t
   Class-MOP/branches/method_generation_cleanup/t/015_metaclass_inheritance.t
   Class-MOP/branches/method_generation_cleanup/t/016_class_errors_and_edge_cases.t
   Class-MOP/branches/method_generation_cleanup/t/017_add_method_modifier.t
   Class-MOP/branches/method_generation_cleanup/t/018_anon_class.t
   Class-MOP/branches/method_generation_cleanup/t/019_anon_class_keep_alive.t
   Class-MOP/branches/method_generation_cleanup/t/020_attribute.t
   Class-MOP/branches/method_generation_cleanup/t/021_attribute_errors_and_edge_cases.t
   Class-MOP/branches/method_generation_cleanup/t/022_attribute_duplication.t
   Class-MOP/branches/method_generation_cleanup/t/023_attribute_get_read_write.t
   Class-MOP/branches/method_generation_cleanup/t/024_attribute_initializer.t
   Class-MOP/branches/method_generation_cleanup/t/030_method.t
   Class-MOP/branches/method_generation_cleanup/t/031_method_modifiers.t
   Class-MOP/branches/method_generation_cleanup/t/040_metaclass.t
   Class-MOP/branches/method_generation_cleanup/t/041_metaclass_incompatibility.t
   Class-MOP/branches/method_generation_cleanup/t/042_metaclass_incompatibility_dyn.t
   Class-MOP/branches/method_generation_cleanup/t/043_instance_metaclass_incompat.t
   Class-MOP/branches/method_generation_cleanup/t/044_instance_metaclass_incompat_dyn.t
   Class-MOP/branches/method_generation_cleanup/t/045_metaclass_loads_classes.t
   Class-MOP/branches/method_generation_cleanup/t/046_rebless_instance.t
   Class-MOP/branches/method_generation_cleanup/t/047_rebless_with_extra_params.t
   Class-MOP/branches/method_generation_cleanup/t/048_anon_class_create_init.t
   Class-MOP/branches/method_generation_cleanup/t/050_scala_style_mixin_composition.t
   Class-MOP/branches/method_generation_cleanup/t/060_instance.t
   Class-MOP/branches/method_generation_cleanup/t/061_instance_inline.t
   Class-MOP/branches/method_generation_cleanup/t/070_immutable_metaclass.t
   Class-MOP/branches/method_generation_cleanup/t/071_immutable_w_custom_metaclass.t
   Class-MOP/branches/method_generation_cleanup/t/072_immutable_w_constructors.t
   Class-MOP/branches/method_generation_cleanup/t/073_make_mutable.t
   Class-MOP/branches/method_generation_cleanup/t/080_meta_package.t
   Class-MOP/branches/method_generation_cleanup/t/081_meta_package_extension.t
   Class-MOP/branches/method_generation_cleanup/t/082_get_code_info.t
   Class-MOP/branches/method_generation_cleanup/t/083_load_class.t
   Class-MOP/branches/method_generation_cleanup/t/100_BinaryTree_test.t
   Class-MOP/branches/method_generation_cleanup/t/101_InstanceCountingClass_test.t
   Class-MOP/branches/method_generation_cleanup/t/102_InsideOutClass_test.t
   Class-MOP/branches/method_generation_cleanup/t/103_Perl6Attribute_test.t
   Class-MOP/branches/method_generation_cleanup/t/104_AttributesWithHistory_test.t
   Class-MOP/branches/method_generation_cleanup/t/105_ClassEncapsulatedAttributes_test.t
   Class-MOP/branches/method_generation_cleanup/t/106_LazyClass_test.t
   Class-MOP/branches/method_generation_cleanup/t/107_C3MethodDispatchOrder_test.t
   Class-MOP/branches/method_generation_cleanup/t/108_ArrayBasedStorage_test.t
   Class-MOP/branches/method_generation_cleanup/t/200_Class_C3_compatibility.t
   Class-MOP/branches/method_generation_cleanup/t/300_random_eval_bug.t
   Class-MOP/branches/method_generation_cleanup/t/301_RT_27329_fix.t
   Class-MOP/branches/method_generation_cleanup/t/302_modify_parent_method.t
   Class-MOP/branches/method_generation_cleanup/t/303_RT_39001_fix.t
   Class-MOP/branches/method_generation_cleanup/t/304_constant_codeinfo.t
   Class-MOP/branches/method_generation_cleanup/t/305_RT_41255.t
   Class-MOP/branches/method_generation_cleanup/t/pod.t
   Class-MOP/branches/method_generation_cleanup/t/pod_coverage.t
Log:
Merge from trunk to method_generation_cleanup branch (all tests pass)


Property changes on: Class-MOP/branches/method_generation_cleanup
___________________________________________________________________
Name: svk:merge
   - 08e7d58d-de06-4458-8c15-335e402ab116:/local/Class-MOP:76670
3efe9002-19ed-0310-8735-a98156148065:/Class-MOP/branches/Class-MOP-accessor-refactoring:1923
3efe9002-19ed-0310-8735-a98156148065:/Class-MOP/branches/Class-MOP-encapsulated_package:1803
3efe9002-19ed-0310-8735-a98156148065:/Class-MOP/branches/Class-MOP-method-fix:1857
3efe9002-19ed-0310-8735-a98156148065:/Class-MOP/branches/Class-MOP-moosex_compile_support:3263
3efe9002-19ed-0310-8735-a98156148065:/Class-MOP/branches/deprecate-alias_method:5914
3efe9002-19ed-0310-8735-a98156148065:/Class-MOP/branches/predicate_fix:2939
3efe9002-19ed-0310-8735-a98156148065:/Class-MOP/trunk:7026
48425d73-d564-4cf1-a4fc-b7d19ba782dc:/local/Class-MOP:54024
f7901bf9-e7b5-442b-97a4-4d7fd5798e10:/local/moose/Class-MOP:36718
   + 08e7d58d-de06-4458-8c15-335e402ab116:/local/Class-MOP:76670
3efe9002-19ed-0310-8735-a98156148065:/Class-MOP/branches/Class-MOP-accessor-refactoring:1923
3efe9002-19ed-0310-8735-a98156148065:/Class-MOP/branches/Class-MOP-encapsulated_package:1803
3efe9002-19ed-0310-8735-a98156148065:/Class-MOP/branches/Class-MOP-method-fix:1857
3efe9002-19ed-0310-8735-a98156148065:/Class-MOP/branches/Class-MOP-moosex_compile_support:3263
3efe9002-19ed-0310-8735-a98156148065:/Class-MOP/branches/deprecate-alias_method:5914
3efe9002-19ed-0310-8735-a98156148065:/Class-MOP/branches/predicate_fix:2939
3efe9002-19ed-0310-8735-a98156148065:/Class-MOP/trunk:7304
48425d73-d564-4cf1-a4fc-b7d19ba782dc:/local/Class-MOP:54024
f7901bf9-e7b5-442b-97a4-4d7fd5798e10:/local/moose/Class-MOP:36718

Modified: Class-MOP/branches/method_generation_cleanup/Changes
===================================================================
--- Class-MOP/branches/method_generation_cleanup/Changes	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/Changes	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,9 +1,35 @@
 Revision history for Perl extension Class-MOP.
 
+    * Tests
+      - Add test showing how the xs Class::MOP::is_class_loaded can
+        be made to operate differently to the pure perl version (t0m)
+
+0.75 Wed, December 31, 2008
+    * Class::MOP::Class
+      - A class that was made immutable and then mutable could end up
+        sharing an immutable transformer object
+        (Class::MOP::Immutable) with other classes, leading to all
+        sorts of odd bugs. Reported by t0m. (Dave Rolsky)
+
+0.74 Tue, December 25, 2008
+    * MOP.xs
+      - Add an xs implementation of Class::MOP::is_class_loaded (closes
+        RT#41862). Based on a patch by Goro Fuji. (Florian Ragwitz)
+      - Changed internals to make prehashing of hash keys easier and less
+        error-prone. (Florian Ragwitz)
+    * Class::MOP::Class
+      - Fix documentation to show that around modifiers happen on both
+        sides of the modified method. (Dave Rolsky)
+
+0.73 Tue, December 16, 2008
+    * MOP.xs
+      - Don't use Perl_mro_meta_init. It's not part of the public perl
+        api. Fixes failures to build on Win32 (RT #41750).  (Florian
+        Ragwitz)
     * t/082_get_code_info.t
-      - Add $^P &= ~0x200; (per Ovid's suggestion) in order to not munger
-        anonymous subs when under -d and so making the tests succeed
-        in that case.
+      - Add $^P &= ~0x200; (per Ovid's suggestion) in order to not
+        munger anonymous subs when under -d and so making the tests
+        succeed in that case.
 
 0.72 Mon, December 8, 2008
     * Class::MOP::Package

Modified: Class-MOP/branches/method_generation_cleanup/MOP.xs
===================================================================
--- Class-MOP/branches/method_generation_cleanup/MOP.xs	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/MOP.xs	2009-01-14 08:46:12 UTC (rev 7305)
@@ -14,41 +14,72 @@
 #define NEED_sv_2pv_nolen
 #include "ppport.h"
 
-SV *key_name;
-U32 hash_name;
+#define DECLARE_KEY(name) SV *key_##name; U32 hash_##name;
 
-SV *key_package;
-U32 hash_package;
+#define PREHASH_KEY_WITH_VALUE(name, value) do { \
+    key_##name = newSVpvs(value); \
+    PERL_HASH(hash_##name, value, sizeof(value) - 1); \
+} while (0)
 
-SV *key_package_name;
-U32 hash_package_name;
+/* this is basically the same as the above macro, except that the value will be
+ * the stringified name. However, we can't just implement this in terms of
+ * PREHASH_KEY_WITH_VALUE as that'd cause macro expansion on the value of
+ * 'name' when it's being passed to the other macro. suggestions on how to make
+ * this more elegant would be much appreciated */
 
-SV *key_body;
-U32 hash_body;
+#define PREHASH_KEY(name) do { \
+    key_##name = newSVpvs(#name); \
+    PERL_HASH(hash_##name, #name, sizeof(#name) - 1); \
+} while (0)
 
-SV *key_package_cache_flag;
-U32 hash_package_cache_flag;
+DECLARE_KEY(name);
+DECLARE_KEY(package);
+DECLARE_KEY(package_name);
+DECLARE_KEY(body);
+DECLARE_KEY(package_cache_flag);
+DECLARE_KEY(methods);
+DECLARE_KEY(VERSION);
+DECLARE_KEY(ISA);
 
-SV *key_methods;
-U32 hash_methods;
-
 SV *method_metaclass;
 SV *associated_metaclass;
 SV *wrap;
 
 
 #define check_package_cache_flag(stash) mop_check_package_cache_flag(aTHX_ stash)
-#ifdef HvMROMETA /* 5.10.0 */
+#if PERL_VERSION >= 10
 
-#ifndef mro_meta_init
-#define mro_meta_init(stash) Perl_mro_meta_init(aTHX_ stash) /* used in HvMROMETA macro */
-#endif /* !mro_meta_init */
-
 static UV
 mop_check_package_cache_flag(pTHX_ HV* stash) {
     assert(SvTYPE(stash) == SVt_PVHV);
 
-    return HvMROMETA(stash)->pkg_gen; /* mro::get_pkg_gen($pkg) */
+    /* here we're trying to implement a c version of mro::get_pkg_gen($stash),
+     * however the perl core doesn't make it easy for us. It doesn't provide an
+     * api that just does what we want.
+     *
+     * However, we know that the information we want is, inside the core,
+     * available using HvMROMETA(stash)->pkg_gen. Unfortunately, although the
+     * HvMROMETA macro is public, it is implemented using Perl_mro_meta_init,
+     * which is not public and only available inside the core, as the mro
+     * interface as well as the structure returned by mro_meta_init isn't
+     * considered to be stable yet.
+     *
+     * Perl_mro_meta_init isn't declared static, so we could just define it
+     * ourselfs if perls headers don't do that for us, except that won't work
+     * on platforms where symbols need to be explicitly exported when linking
+     * shared libraries.
+     *
+     * So our, hopefully temporary, solution is to be even more evil and
+     * basically reimplement HvMROMETA in a very fragile way that'll blow up
+     * when the relevant parts of the mro implementation in core change.
+     *
+     * :-(
+     *
+     */
+
+    return HvAUX(stash)->xhv_mro_meta
+         ? HvAUX(stash)->xhv_mro_meta->pkg_gen
+         : 0;
 }
 
 #else /* pre 5.10.0 */
@@ -282,31 +313,27 @@
 MODULE = Class::MOP   PACKAGE = Class::MOP
 
 BOOT:
-    key_name = newSVpvs("name");
-    key_body = newSVpvs("body");
-    key_package = newSVpvs("package");
-    key_package_name = newSVpvs("package_name");
-    key_package_cache_flag = newSVpvs("_package_cache_flag");
-    key_methods = newSVpvs("methods");
+    PREHASH_KEY(name);
+    PREHASH_KEY(body);
+    PREHASH_KEY(package);
+    PREHASH_KEY(package_name);
+    PREHASH_KEY(methods);
+    PREHASH_KEY(ISA);
+    PREHASH_KEY(VERSION);
+    PREHASH_KEY_WITH_VALUE(package_cache_flag, "_package_cache_flag");
 
-    PERL_HASH(hash_name, "name", 4);
-    PERL_HASH(hash_body, "body", 4);
-    PERL_HASH(hash_package, "package", 7);
-    PERL_HASH(hash_package_name, "package_name", 12);
-    PERL_HASH(hash_package_cache_flag, "_package_cache_flag", 19);
-    PERL_HASH(hash_methods, "methods", 7);
-
     method_metaclass     = newSVpvs("method_metaclass");
     wrap                 = newSVpvs("wrap");
     associated_metaclass = newSVpvs("associated_metaclass");
 
 
-PROTOTYPES: ENABLE
+PROTOTYPES: DISABLE
 
-
+# use prototype here to be compatible with get_code_info from Sub::Identify
 void
 get_code_info(coderef)
     SV *coderef
+    PROTOTYPE: $
     PREINIT:
         char *pkg  = NULL;
         char *name = NULL;
@@ -317,14 +344,61 @@
             PUSHs(newSVpv(name, 0));
         }
 
+void
+is_class_loaded(klass=&PL_sv_undef)
+    SV *klass
+    PREINIT:
+        HV *stash;
+        char *key;
+        I32 keylen;
+        GV *gv;
+    PPCODE:
+        if (!SvPOK(klass) || !SvCUR(klass)) {
+            XSRETURN_NO;
+        }
 
+        stash = gv_stashsv(klass, 0);
+        if (!stash) {
+            XSRETURN_NO;
+        }
+
+        if (hv_exists_ent (stash, key_VERSION, hash_VERSION)) {
+            HE *version = hv_fetch_ent(stash, key_VERSION, 0, hash_VERSION);
+            if (version && HeVAL(version) && GvSV(HeVAL(version))) {
+                XSRETURN_YES;
+            }
+        }
+
+        if (hv_exists_ent (stash, key_ISA, hash_ISA)) {
+            HE *isa = hv_fetch_ent(stash, key_ISA, 0, hash_ISA);
+            if (isa && HeVAL(isa) && GvAV(HeVAL(isa))) {
+                XSRETURN_YES;
+            }
+        }
+
+        (void)hv_iterinit(stash);
+        while ((gv = (GV *)hv_iternextsv(stash, &key, &keylen))) {
+            if (keylen <= 0) {
+                continue;
+            }
+
+            if (key[keylen - 1] == ':' && key[keylen - 2] == ':') {
+                continue;
+            }
+
+            if (!isGV(gv) || GvCV(gv) || GvSV(gv) || GvAV(gv) || GvHV(gv) || GvIO(gv) || GvFORM(gv)) {
+                XSRETURN_YES;
+            }
+        }
+
+        XSRETURN_NO;
+
 MODULE = Class::MOP   PACKAGE = Class::MOP::Package
 
 void
 get_all_package_symbols(self, filter=TYPE_FILTER_NONE)
     SV *self
     type_filter_t filter
-    PROTOTYPE: $;$
     PREINIT:
         HV *stash = NULL;
         HV *symbols = NULL;

Modified: Class-MOP/branches/method_generation_cleanup/Makefile.PL
===================================================================
--- Class-MOP/branches/method_generation_cleanup/Makefile.PL	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/Makefile.PL	2009-01-14 08:46:12 UTC (rev 7305)
@@ -18,7 +18,7 @@
     /^--xs/ and $force_xs = 1;
 }
 
-my $has_compiler = $force_xs;
+our $has_compiler = $force_xs;
 unless ( defined $force_xs ) {
     $has_compiler = check_for_compiler()
         or no_cc();
@@ -41,10 +41,6 @@
 delete @prereqs{qw(Sub::Name Devel::GlobalDestruction)}
     unless $has_compiler;
 
-if ($has_compiler && is_maintainer()) {
-    create_pp_tests();
-}
-
 write_makefile();
 
 sub write_makefile {
@@ -131,32 +127,12 @@
     return 1;
 }
 
-sub create_pp_tests {
+sub get_pp_tests {
     opendir my $dh, 't' or die "Cannot read t: $!";
 
-    foreach my $file ( grep {/^\d.+\.t$/} readdir $dh ) {
-        next if $file =~ /^99/;
-
-        my $real_file = File::Spec->catfile( 't', $file );
-
-        open my $fh, '<', $real_file
-            or die "Cannot read $real_file: $!";
-
-        my $shbang = <$fh>;
-        my $test = do { local $/; <$fh> };
-
-        close $fh;
-
-        $test = "$shbang\nBEGIN { \$ENV{CLASS_MOP_NO_XS} = 1 }\n\n$test";
-
-        my $new_file = File::Spec->catfile( 't', "pp_$file" );
-        open my $new_fh, '>', $new_file
-            or die "Cannot write to $new_file: $!";
-
-        print $new_fh $test;
-
-        close $new_fh;
-    }
+    return map {
+        File::Spec->catfile('t', "pp_${_}")
+    } grep { $_ !~ /^99/ } grep {/^\d.+\.t$/} readdir $dh;
 }
 
 # This is EUMM voodoo
@@ -169,3 +145,21 @@
 
     $hash;
 }
+
+package MY;
+
+sub postamble {
+    my $pp_tests = join q{ }, ::get_pp_tests();
+    my $test_dep = $::has_compiler && ::is_maintainer()
+        ? 'pure_all :: pp_tests'
+        : '';
+
+    return <<"EOM"
+pp_tests: ${pp_tests}
+
+${test_dep}
+
+t/pp_%: t/% t/header_pp.inc
+\t\$(NOECHO) \$(ABSPERLRUN) "-MExtUtils::Command" -e cat t/header_pp.inc \$< > \$@
+EOM
+}

Modified: Class-MOP/branches/method_generation_cleanup/README
===================================================================
--- Class-MOP/branches/method_generation_cleanup/README	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/README	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,4 +1,4 @@
-Class::MOP version 0.72
+Class::MOP version 0.75
 ===========================
 
 See the individual module documentation for more information

Modified: Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Attribute.pm
===================================================================
--- Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Attribute.pm	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Attribute.pm	2009-01-14 08:46:12 UTC (rev 7305)
@@ -9,7 +9,7 @@
 use Carp         'confess';
 use Scalar::Util 'blessed', 'weaken';
 
-our $VERSION   = '0.72';
+our $VERSION   = '0.75';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 
@@ -60,16 +60,17 @@
     my $options = @_ == 1 ? $_[0] : {@_};
 
     bless {
-        'name'        => $options->{name},
-        'accessor'    => $options->{accessor},
-        'reader'      => $options->{reader},
-        'writer'      => $options->{writer},
-        'predicate'   => $options->{predicate},
-        'clearer'     => $options->{clearer},
-        'builder'     => $options->{builder},
-        'init_arg'    => $options->{init_arg},
-        'default'     => $options->{default},
-        'initializer' => $options->{initializer},        
+        'name'               => $options->{name},
+        'accessor'           => $options->{accessor},
+        'reader'             => $options->{reader},
+        'writer'             => $options->{writer},
+        'predicate'          => $options->{predicate},
+        'clearer'            => $options->{clearer},
+        'builder'            => $options->{builder},
+        'init_arg'           => $options->{init_arg},
+        'default'            => $options->{default},
+        'initializer'        => $options->{initializer},
+        'definition_context' => $options->{definition_context},
         # keep a weakened link to the
         # class we are associated with
         'associated_class' => undef,
@@ -165,14 +166,15 @@
 sub has_default     { defined($_[0]->{'default'}) }
 sub has_initializer { defined($_[0]->{'initializer'}) }
 
-sub accessor    { $_[0]->{'accessor'}    }
-sub reader      { $_[0]->{'reader'}      }
-sub writer      { $_[0]->{'writer'}      }
-sub predicate   { $_[0]->{'predicate'}   }
-sub clearer     { $_[0]->{'clearer'}     }
-sub builder     { $_[0]->{'builder'}     }
-sub init_arg    { $_[0]->{'init_arg'}    }
-sub initializer { $_[0]->{'initializer'} }
+sub accessor           { $_[0]->{'accessor'}    }
+sub reader             { $_[0]->{'reader'}      }
+sub writer             { $_[0]->{'writer'}      }
+sub predicate          { $_[0]->{'predicate'}   }
+sub clearer            { $_[0]->{'clearer'}     }
+sub builder            { $_[0]->{'builder'}     }
+sub init_arg           { $_[0]->{'init_arg'}    }
+sub initializer        { $_[0]->{'initializer'} }
+sub definition_context { $_[0]->{'definition_context'} }
 
 # end bootstrapped away method section.
 # (all methods below here are kept intact)
@@ -330,6 +332,13 @@
 
 sub process_accessors {
     my ($self, $type, $accessor, $generate_as_inline_methods) = @_;
+
+    my $method_ctx;
+
+    if ( my $ctx = $self->definition_context ) {
+        $method_ctx = { %$ctx };
+    }
+
     if (ref($accessor)) {
         (ref($accessor) eq 'HASH')
             || confess "bad accessor/reader/writer/predicate/clearer format, must be a HASH ref";
@@ -338,6 +347,7 @@
             $method,
             package_name => $self->associated_class->name,
             name         => $name,
+            definition_context => $method_ctx,
         );
         $self->associate_method($method);
         return ($name, $method);
@@ -346,12 +356,22 @@
         my $inline_me = ($generate_as_inline_methods && $self->associated_class->instance_metaclass->is_inlinable);
         my $method;
         eval {
+            if ( $method_ctx ) {
+                my $desc = "accessor $accessor";
+                if ( $accessor ne $self->name ) {
+                    $desc .= " of attribute " . $self->name;
+                }
+
+                $method_ctx->{description} = $desc;
+            }
+
             $method = $self->accessor_metaclass->new(
                 attribute     => $self,
                 is_inline     => $inline_me,
                 accessor_type => $type,
                 package_name  => $self->associated_class->name,
                 name          => $accessor,
+                definition_context => $method_ctx,
             );
         };
         confess "Could not create the '$type' method for " . $self->name . " because : $@" if $@;

Modified: Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Class.pm
===================================================================
--- Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Class.pm	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Class.pm	2009-01-14 08:46:12 UTC (rev 7305)
@@ -11,7 +11,7 @@
 use Carp         'confess';
 use Scalar::Util 'blessed', 'weaken';
 
-our $VERSION   = '0.72';
+our $VERSION   = '0.75';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 
@@ -744,12 +744,6 @@
     (defined $method_name && $method_name)
         || confess "You must define a method name";
 
-    # NOTE:
-    # I don't really need this here, because
-    # if the method_map is missing a key it
-    # will just return undef for me now
-    # return unless $self->has_method($method_name);
-
     return $self->{methods}{$method_name} || $self->get_method_map->{$method_name};
 }
 
@@ -1055,8 +1049,7 @@
     sub get_immutable_transformer {
         my $self = shift;
         if( $self->is_mutable ){
-            my $class = ref $self || $self;
-            return $IMMUTABLE_TRANSFORMERS{$class} ||= $self->create_immutable_transformer;
+            return $IMMUTABLE_TRANSFORMERS{$self->name} ||= $self->create_immutable_transformer;
         }
         confess "unable to find transformer for immutable class"
             unless exists $IMMUTABLE_OPTIONS{$self->name};
@@ -1355,7 +1348,7 @@
 C<bless>-ing into your package of choice. It works in conjunction
 with the Attribute protocol to collect all applicable attributes.
 
-This will construct and instance using a HASH ref as storage
+This will construct an instance using a HASH ref as storage
 (currently only HASH references are supported). This will collect all
 the applicable attributes and layout out the fields in the HASH ref,
 it will then initialize them using either use the corresponding key
@@ -1460,7 +1453,8 @@
 
 =item B<get_method_map>
 
-Returns a HASH ref of name to CODE reference mapping for this class.
+Returns a HASH ref of name to L<Class::MOP::Method> instance mapping
+for this class.
 
 =item B<method_metaclass>
 
@@ -1526,16 +1520,17 @@
 
 =item B<find_method_by_name ($method_name)>
 
-This will return a CODE reference of the specified C<$method_name>,
-or return undef if that method does not exist.
+This will return a L<Class::MOP::Method> instance for the specified
+C<$method_name>, or return undef if that method does not exist.
 
 Unlike C<get_method> this will also look in the superclasses.
 
 =item B<remove_method ($method_name)>
 
 This will attempt to remove a given C<$method_name> from the class.
-It will return the CODE reference that it has removed, and will
-attempt to use B<Sub::Name> to clear the methods associated name.
+It will return the L<Class::MOP::Method> instance that it has removed,
+and will attempt to use B<Sub::Name> to clear the methods associated
+name.
 
 =item B<get_method_list>
 
@@ -1620,8 +1615,10 @@
     around 2
      around 1
       primary
-     after 1
-    after 2
+     around 1
+    around 2
+   after 1
+  after 2
 
 To see examples of using method modifiers, see the following examples
 included in the distribution; F<InstanceCountingClass>, F<Perl6Attribute>,

Modified: Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Immutable.pm
===================================================================
--- Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Immutable.pm	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Immutable.pm	2009-01-14 08:46:12 UTC (rev 7305)
@@ -9,7 +9,7 @@
 use Carp         'confess';
 use Scalar::Util 'blessed';
 
-our $VERSION   = '0.72';
+our $VERSION   = '0.75';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Instance.pm
===================================================================
--- Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Instance.pm	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Instance.pm	2009-01-14 08:46:12 UTC (rev 7305)
@@ -6,7 +6,7 @@
 
 use Scalar::Util 'weaken', 'blessed';
 
-our $VERSION   = '0.72';
+our $VERSION   = '0.75';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Method/Accessor.pm
===================================================================
--- Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Method/Accessor.pm	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Method/Accessor.pm	2009-01-14 08:46:12 UTC (rev 7305)
@@ -7,7 +7,7 @@
 use Carp         'confess';
 use Scalar::Util 'blessed', 'weaken';
 
-our $VERSION   = '0.72';
+our $VERSION   = '0.75';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Method/Constructor.pm
===================================================================
--- Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Method/Constructor.pm	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Method/Constructor.pm	2009-01-14 08:46:12 UTC (rev 7305)
@@ -7,7 +7,7 @@
 use Carp         'confess';
 use Scalar::Util 'blessed', 'weaken', 'looks_like_number';
 
-our $VERSION   = '0.72';
+our $VERSION   = '0.75';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Method/Generated.pm
===================================================================
--- Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Method/Generated.pm	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Method/Generated.pm	2009-01-14 08:46:12 UTC (rev 7305)
@@ -6,7 +6,7 @@
 
 use Carp 'confess';
 
-our $VERSION   = '0.72';
+our $VERSION   = '0.75';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 
@@ -26,6 +26,32 @@
     return $self;
 }
 
+
+sub _prepare_code {
+    my ( $self, %args ) = @_;
+
+    my ( $line, $file );
+
+    if ( my $ctx = ( $args{context} || $self->definition_context ) ) {
+        $line = $ctx->{line};
+        if ( my $desc = $ctx->{description} ) {
+            $file = "$desc defined at $ctx->{file}";
+        } else {
+            $file = $ctx->{file};
+        }
+    } else {
+        ( $line, $file ) = ( 0, "generated method (unknown origin)" );
+    }
+
+    my $code = $args{code};
+
+    # if it's an array of lines, join it up
+    # don't use newlines so that the definition context is more meaningful
+    $code = join(@$code, ' ') if ref $code;
+
+    return qq{#line $line "$file"\n} . $code;
+}
+
 sub _new {
     my $class = shift;
     my $options = @_ == 1 ? $_[0] : {@_};
@@ -38,8 +64,10 @@
 
 ## accessors
 
-sub is_inline { (shift)->{'is_inline'} }
+sub is_inline { $_[0]{is_inline} }
 
+sub definition_context { $_[0]{definition_context} }
+
 sub initialize_body {
     confess "No body to initialize, " . __PACKAGE__ . " is an abstract base class";
 }

Modified: Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Method/Wrapped.pm
===================================================================
--- Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Method/Wrapped.pm	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Method/Wrapped.pm	2009-01-14 08:46:12 UTC (rev 7305)
@@ -7,7 +7,7 @@
 use Carp         'confess';
 use Scalar::Util 'blessed';
 
-our $VERSION   = '0.72';
+our $VERSION   = '0.75';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Method.pm
===================================================================
--- Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Method.pm	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Method.pm	2009-01-14 08:46:12 UTC (rev 7305)
@@ -7,7 +7,7 @@
 use Carp         'confess';
 use Scalar::Util 'weaken';
 
-our $VERSION   = '0.72';
+our $VERSION   = '0.75';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Module.pm
===================================================================
--- Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Module.pm	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Module.pm	2009-01-14 08:46:12 UTC (rev 7305)
@@ -7,7 +7,7 @@
 use Carp         'confess';
 use Scalar::Util 'blessed';
 
-our $VERSION   = '0.72';
+our $VERSION   = '0.75';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Object.pm
===================================================================
--- Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Object.pm	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Object.pm	2009-01-14 08:46:12 UTC (rev 7305)
@@ -6,7 +6,7 @@
 
 use Scalar::Util 'blessed';
 
-our $VERSION   = '0.72';
+our $VERSION   = '0.75';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Package.pm
===================================================================
--- Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Package.pm	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/lib/Class/MOP/Package.pm	2009-01-14 08:46:12 UTC (rev 7305)
@@ -8,7 +8,7 @@
 use Scalar::Util 'blessed';
 use Carp         'confess';
 
-our $VERSION   = '0.72';
+our $VERSION   = '0.75';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: Class-MOP/branches/method_generation_cleanup/lib/Class/MOP.pm
===================================================================
--- Class-MOP/branches/method_generation_cleanup/lib/Class/MOP.pm	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/lib/Class/MOP.pm	2009-01-14 08:46:12 UTC (rev 7305)
@@ -31,7 +31,7 @@
     *check_package_cache_flag = \&mro::get_pkg_gen;
 }
 
-our $VERSION   = '0.72';
+our $VERSION   = '0.75';
 our $XS_VERSION = $VERSION;
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';    
@@ -449,6 +449,12 @@
 );
 
 Class::MOP::Attribute->meta->add_attribute(
+    Class::MOP::Attribute->new('definition_context' => (
+        reader    => { 'definition_context'     => \&Class::MOP::Attribute::definition_context     },
+    ))
+);
+
+Class::MOP::Attribute->meta->add_attribute(
     Class::MOP::Attribute->new('writer' => (
         reader    => { 'writer'     => \&Class::MOP::Attribute::writer     },
         predicate => { 'has_writer' => \&Class::MOP::Attribute::has_writer },
@@ -564,6 +570,12 @@
     ))
 );
 
+Class::MOP::Method::Generated->meta->add_attribute(
+    Class::MOP::Attribute->new('definition_context' => (
+        reader   => { 'definition_context' => \&Class::MOP::Method::Generated::definition_context },
+    ))
+);
+
 ## --------------------------------------------------------
 ## Class::MOP::Method::Accessor
 
@@ -953,32 +965,32 @@
 
 =head2 Metaclass cache functions
 
-Class::MOP holds a cache of metaclasses, the following are functions
+Class::MOP holds a cache of metaclasses. The following are functions
 (B<not methods>) which can be used to access that cache. It is not
-recommended that you mess with this, bad things could happen. But if
-you are brave and willing to risk it, go for it.
+recommended that you mess with these. Bad things could happen, but if
+you are brave and willing to risk it: go for it!
 
 =over 4
 
 =item B<get_all_metaclasses>
 
-This will return an hash of all the metaclass instances that have
-been cached by B<Class::MOP::Class> keyed by the package name.
+This will return a hash of all the metaclass instances that have
+been cached by B<Class::MOP::Class>, keyed by the package name.
 
 =item B<get_all_metaclass_instances>
 
-This will return an array of all the metaclass instances that have
+This will return a list of all the metaclass instances that have
 been cached by B<Class::MOP::Class>.
 
 =item B<get_all_metaclass_names>
 
-This will return an array of all the metaclass names that have
+This will return a list of all the metaclass names that have
 been cached by B<Class::MOP::Class>.
 
 =item B<get_metaclass_by_name ($name)>
 
-This will return a cached B<Class::MOP::Class> instance of nothing
-if no metaclass exist by that C<$name>.
+This will return a cached B<Class::MOP::Class> instance, or nothing
+if no metaclass exists with that C<$name>.
 
 =item B<store_metaclass_by_name ($name, $meta)>
 
@@ -986,18 +998,19 @@
 
 =item B<weaken_metaclass ($name)>
 
-In rare cases it is desireable to store a weakened reference in 
-the metaclass cache. This function will weaken the reference to 
-the metaclass stored in C<$name>.
+In rare cases (e.g. anonymous metaclasses) it is desirable to
+store a weakened reference in the metaclass cache. This
+function will weaken the reference to the metaclass stored
+in C<$name>.
 
 =item B<does_metaclass_exist ($name)>
 
 This will return true of there exists a metaclass stored in the 
-C<$name> key and return false otherwise.
+C<$name> key, and return false otherwise.
 
 =item B<remove_metaclass_by_name ($name)>
 
-This will remove a the metaclass stored in the C<$name> key.
+This will remove the metaclass stored in the C<$name> key.
 
 =back
 

Modified: Class-MOP/branches/method_generation_cleanup/lib/metaclass.pm
===================================================================
--- Class-MOP/branches/method_generation_cleanup/lib/metaclass.pm	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/lib/metaclass.pm	2009-01-14 08:46:12 UTC (rev 7305)
@@ -7,7 +7,7 @@
 use Carp         'confess';
 use Scalar::Util 'blessed';
 
-our $VERSION   = '0.72';
+our $VERSION   = '0.75';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 

Modified: Class-MOP/branches/method_generation_cleanup/t/000_load.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/000_load.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/000_load.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 
@@ -7,23 +5,24 @@
 
 BEGIN {
     use_ok('Class::MOP');
-    use_ok('Class::MOP::Package');    
-    use_ok('Class::MOP::Module');        
+    use_ok('Class::MOP::Package');
+    use_ok('Class::MOP::Module');
     use_ok('Class::MOP::Class');
-    use_ok('Class::MOP::Immutable');    
+    use_ok('Class::MOP::Immutable');
     use_ok('Class::MOP::Attribute');
-    use_ok('Class::MOP::Method');  
-    use_ok('Class::MOP::Method::Wrapped');                
-    use_ok('Class::MOP::Method::Generated');     
-    use_ok('Class::MOP::Method::Accessor');                    
-    use_ok('Class::MOP::Method::Constructor');                    
-    use_ok('Class::MOP::Instance');            
-    use_ok('Class::MOP::Object');                
+    use_ok('Class::MOP::Method');
+    use_ok('Class::MOP::Method::Wrapped');
+    use_ok('Class::MOP::Method::Generated');
+    use_ok('Class::MOP::Method::Accessor');
+    use_ok('Class::MOP::Method::Constructor');
+    use_ok('Class::MOP::Instance');
+    use_ok('Class::MOP::Object');
 }
 
 # make sure we are tracking metaclasses correctly
 
-my $CLASS_MOP_CLASS_IMMUTABLE_CLASS = 'Class::MOP::Class::__ANON__::SERIAL::1';
+my @CLASS_MOP_CLASS_IMMUTABLE_CLASSES
+    = map { 'Class::MOP::Class::__ANON__::SERIAL::' . $_ } 1..11;
 
 my %METAS = (
     'Class::MOP::Attribute'         => Class::MOP::Attribute->meta,
@@ -40,81 +39,112 @@
     'Class::MOP::Object'          => Class::MOP::Object->meta,
 );
 
-ok(Class::MOP::is_class_loaded($_), '... ' . $_ . ' is loaded') for keys %METAS;
+ok( Class::MOP::is_class_loaded($_), '... ' . $_ . ' is loaded' )
+    for keys %METAS;
 
-ok($_->is_immutable(), '... ' . $_->name . ' is immutable') for values %METAS;
+ok( $_->is_immutable(), '... ' . $_->name . ' is immutable' )
+    for values %METAS;
 
 is_deeply(
-    { Class::MOP::get_all_metaclasses },
+    {Class::MOP::get_all_metaclasses},
     {
         %METAS,
-        $CLASS_MOP_CLASS_IMMUTABLE_CLASS => $CLASS_MOP_CLASS_IMMUTABLE_CLASS->meta
+        map { $_ => $_->meta } @CLASS_MOP_CLASS_IMMUTABLE_CLASSES
     },
-    '... got all the metaclasses');
+    '... got all the metaclasses'
+);
 
 is_deeply(
-    [ sort { $a->name cmp $b->name } Class::MOP::get_all_metaclass_instances ],
-    [ 
-        Class::MOP::Attribute->meta, 
-        Class::MOP::Class->meta, 
-        $CLASS_MOP_CLASS_IMMUTABLE_CLASS->meta,         
-        Class::MOP::Instance->meta,         
+    [
+        sort { $a->name cmp $b->name } Class::MOP::get_all_metaclass_instances
+    ],
+    [
+        Class::MOP::Attribute->meta,
+        Class::MOP::Class->meta,
+        ( map { $_->meta } sort @CLASS_MOP_CLASS_IMMUTABLE_CLASSES ),
+        Class::MOP::Instance->meta,
         Class::MOP::Method->meta,
         Class::MOP::Method::Accessor->meta,
-        Class::MOP::Method::Constructor->meta,                        
-        Class::MOP::Method::Generated->meta,        
+        Class::MOP::Method::Constructor->meta,
+        Class::MOP::Method::Generated->meta,
         Class::MOP::Method::Wrapped->meta,
-        Class::MOP::Module->meta, 
-        Class::MOP::Object->meta,          
-        Class::MOP::Package->meta,             
+        Class::MOP::Module->meta,
+        Class::MOP::Object->meta,
+        Class::MOP::Package->meta,
     ],
-    '... got all the metaclass instances');
+    '... got all the metaclass instances'
+);
 
 is_deeply(
     [ sort { $a cmp $b } Class::MOP::get_all_metaclass_names() ],
-    [ sort qw/
-        Class::MOP::Attribute      
-        Class::MOP::Class
-        Class::MOP::Instance
-        Class::MOP::Method
-        Class::MOP::Method::Accessor 
-        Class::MOP::Method::Constructor   
-        Class::MOP::Method::Generated             
-        Class::MOP::Method::Wrapped
-        Class::MOP::Module  
-        Class::MOP::Object        
-        Class::MOP::Package                      
-    /,  $CLASS_MOP_CLASS_IMMUTABLE_CLASS  ],
-    '... got all the metaclass names');
-    
+    [
+        sort qw/
+            Class::MOP::Attribute
+            Class::MOP::Class
+            Class::MOP::Instance
+            Class::MOP::Method
+            Class::MOP::Method::Accessor
+            Class::MOP::Method::Constructor
+            Class::MOP::Method::Generated
+            Class::MOP::Method::Wrapped
+            Class::MOP::Module
+            Class::MOP::Object
+            Class::MOP::Package
+            /, @CLASS_MOP_CLASS_IMMUTABLE_CLASSES
+    ],
+    '... got all the metaclass names'
+);
+
 is_deeply(
-    [ map { $_->meta->identifier } sort { $a cmp $b } Class::MOP::get_all_metaclass_names() ],
-    [ 
-       "Class::MOP::Attribute-"           . $Class::MOP::Attribute::VERSION           . "-cpan:STEVAN",  
-       "Class::MOP::Class-"               . $Class::MOP::Class::VERSION               . "-cpan:STEVAN",
-       $CLASS_MOP_CLASS_IMMUTABLE_CLASS,
-       "Class::MOP::Instance-"            . $Class::MOP::Instance::VERSION            . "-cpan:STEVAN",
-       "Class::MOP::Method-"              . $Class::MOP::Method::VERSION              . "-cpan:STEVAN",
-       "Class::MOP::Method::Accessor-"    . $Class::MOP::Method::Accessor::VERSION    . "-cpan:STEVAN",                 
-       "Class::MOP::Method::Constructor-" . $Class::MOP::Method::Constructor::VERSION . "-cpan:STEVAN",
-       "Class::MOP::Method::Generated-"   . $Class::MOP::Method::Generated::VERSION   . "-cpan:STEVAN",                        
-       "Class::MOP::Method::Wrapped-"     . $Class::MOP::Method::Wrapped::VERSION     . "-cpan:STEVAN",       
-       "Class::MOP::Module-"              . $Class::MOP::Module::VERSION              . "-cpan:STEVAN",
-       "Class::MOP::Object-"              . $Class::MOP::Object::VERSION              . "-cpan:STEVAN",
-       "Class::MOP::Package-"             . $Class::MOP::Package::VERSION             . "-cpan:STEVAN",
+    [
+        map      { $_->meta->identifier }
+            sort { $a cmp $b } Class::MOP::get_all_metaclass_names()
     ],
-    '... got all the metaclass identifiers');    
-        
+    [
+        "Class::MOP::Attribute-"
+            . $Class::MOP::Attribute::VERSION
+            . "-cpan:STEVAN",
+        "Class::MOP::Class-" . $Class::MOP::Class::VERSION . "-cpan:STEVAN",
+        ( sort @CLASS_MOP_CLASS_IMMUTABLE_CLASSES ),
+        "Class::MOP::Instance-"
+            . $Class::MOP::Instance::VERSION
+            . "-cpan:STEVAN",
+        "Class::MOP::Method-" . $Class::MOP::Method::VERSION . "-cpan:STEVAN",
+        "Class::MOP::Method::Accessor-"
+            . $Class::MOP::Method::Accessor::VERSION
+            . "-cpan:STEVAN",
+        "Class::MOP::Method::Constructor-"
+            . $Class::MOP::Method::Constructor::VERSION
+            . "-cpan:STEVAN",
+        "Class::MOP::Method::Generated-"
+            . $Class::MOP::Method::Generated::VERSION
+            . "-cpan:STEVAN",
+        "Class::MOP::Method::Wrapped-"
+            . $Class::MOP::Method::Wrapped::VERSION
+            . "-cpan:STEVAN",
+        "Class::MOP::Module-" . $Class::MOP::Module::VERSION . "-cpan:STEVAN",
+        "Class::MOP::Object-" . $Class::MOP::Object::VERSION . "-cpan:STEVAN",
+        "Class::MOP::Package-"
+            . $Class::MOP::Package::VERSION
+            . "-cpan:STEVAN",
+    ],
+    '... got all the metaclass identifiers'
+);
+
 # testing the meta-circularity of the system
 
-is(Class::MOP::Class->meta, Class::MOP::Class->meta->meta, 
-   '... Class::MOP::Class->meta == Class::MOP::Class->meta->meta');
-   
-is(Class::MOP::Class->meta, Class::MOP::Class->meta->meta->meta, 
-  '... Class::MOP::Class->meta == Class::MOP::Class->meta->meta->meta');   
+is(
+    Class::MOP::Class->meta, Class::MOP::Class->meta->meta,
+    '... Class::MOP::Class->meta == Class::MOP::Class->meta->meta'
+);
 
-is(Class::MOP::Class->meta, Class::MOP::Class->meta->meta->meta->meta, 
-   '... Class::MOP::Class->meta == Class::MOP::Class->meta->meta->meta->meta');  
+is(
+    Class::MOP::Class->meta, Class::MOP::Class->meta->meta->meta,
+    '... Class::MOP::Class->meta == Class::MOP::Class->meta->meta->meta'
+);
 
+is(
+    Class::MOP::Class->meta, Class::MOP::Class->meta->meta->meta->meta,
+    '... Class::MOP::Class->meta == Class::MOP::Class->meta->meta->meta->meta'
+);
 
-

Modified: Class-MOP/branches/method_generation_cleanup/t/001_basic.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/001_basic.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/001_basic.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/002_class_precedence_list.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/002_class_precedence_list.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/002_class_precedence_list.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/003_methods.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/003_methods.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/003_methods.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/004_advanced_methods.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/004_advanced_methods.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/004_advanced_methods.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/005_attributes.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/005_attributes.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/005_attributes.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/006_new_and_clone_metaclasses.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/006_new_and_clone_metaclasses.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/006_new_and_clone_metaclasses.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/010_self_introspection.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/010_self_introspection.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/010_self_introspection.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/011_create_class.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/011_create_class.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/011_create_class.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/012_package_variables.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/012_package_variables.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/012_package_variables.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/013_add_attribute_alternate.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/013_add_attribute_alternate.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/013_add_attribute_alternate.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/014_attribute_introspection.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/014_attribute_introspection.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/014_attribute_introspection.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,9 +1,7 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 
-use Test::More tests => 62;
+use Test::More tests => 64;
 use Test::Exception;
 
 use Class::MOP;
@@ -37,6 +35,8 @@
         has_default       default           is_default_a_coderef
         has_initializer   initializer
 
+        definition_context
+
         slots
         get_value
         set_value
@@ -79,6 +79,7 @@
         'builder',
         'init_arg',
         'initializer',
+        'definition_context',
         'default',
         'associated_class',
         'associated_methods',

Modified: Class-MOP/branches/method_generation_cleanup/t/015_metaclass_inheritance.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/015_metaclass_inheritance.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/015_metaclass_inheritance.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/016_class_errors_and_edge_cases.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/016_class_errors_and_edge_cases.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/016_class_errors_and_edge_cases.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/017_add_method_modifier.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/017_add_method_modifier.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/017_add_method_modifier.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/018_anon_class.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/018_anon_class.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/018_anon_class.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/019_anon_class_keep_alive.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/019_anon_class_keep_alive.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/019_anon_class_keep_alive.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/020_attribute.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/020_attribute.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/020_attribute.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/021_attribute_errors_and_edge_cases.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/021_attribute_errors_and_edge_cases.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/021_attribute_errors_and_edge_cases.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/022_attribute_duplication.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/022_attribute_duplication.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/022_attribute_duplication.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/023_attribute_get_read_write.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/023_attribute_get_read_write.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/023_attribute_get_read_write.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/024_attribute_initializer.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/024_attribute_initializer.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/024_attribute_initializer.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/030_method.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/030_method.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/030_method.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/031_method_modifiers.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/031_method_modifiers.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/031_method_modifiers.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/040_metaclass.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/040_metaclass.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/040_metaclass.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/041_metaclass_incompatibility.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/041_metaclass_incompatibility.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/041_metaclass_incompatibility.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/042_metaclass_incompatibility_dyn.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/042_metaclass_incompatibility_dyn.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/042_metaclass_incompatibility_dyn.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/043_instance_metaclass_incompat.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/043_instance_metaclass_incompat.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/043_instance_metaclass_incompat.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/044_instance_metaclass_incompat_dyn.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/044_instance_metaclass_incompat_dyn.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/044_instance_metaclass_incompat_dyn.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/045_metaclass_loads_classes.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/045_metaclass_loads_classes.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/045_metaclass_loads_classes.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/046_rebless_instance.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/046_rebless_instance.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/046_rebless_instance.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/047_rebless_with_extra_params.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/047_rebless_with_extra_params.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/047_rebless_with_extra_params.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/048_anon_class_create_init.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/048_anon_class_create_init.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/048_anon_class_create_init.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/050_scala_style_mixin_composition.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/050_scala_style_mixin_composition.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/050_scala_style_mixin_composition.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/060_instance.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/060_instance.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/060_instance.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/061_instance_inline.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/061_instance_inline.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/061_instance_inline.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/070_immutable_metaclass.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/070_immutable_metaclass.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/070_immutable_metaclass.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/071_immutable_w_custom_metaclass.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/071_immutable_w_custom_metaclass.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/071_immutable_w_custom_metaclass.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 
@@ -49,7 +47,8 @@
 {
     my $meta = Baz->meta;
     ok($meta->is_mutable, '... Baz is mutable');
-    is(Scalar::Util::blessed(Foo->meta), Scalar::Util::blessed(Bar->meta), 'Foo and Bar immutable metaclasses match');
+    isnt(Scalar::Util::blessed(Foo->meta), Scalar::Util::blessed(Bar->meta),
+         'Foo and Bar immutable metaclasses do not match');
     is(Scalar::Util::blessed($meta), 'MyMetaClass', 'Baz->meta blessed as MyMetaClass');
     ok(Baz->can('mymetaclass_attributes'), '... Baz can do method before immutable');
     ok($meta->can('mymetaclass_attributes'), '... meta can do method before immutable');

Modified: Class-MOP/branches/method_generation_cleanup/t/072_immutable_w_constructors.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/072_immutable_w_constructors.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/072_immutable_w_constructors.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/073_make_mutable.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/073_make_mutable.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/073_make_mutable.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,9 +1,7 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 
-use Test::More tests => 113;
+use Test::More tests => 114;
 use Test::Exception;
 
 use Scalar::Util;
@@ -228,3 +226,12 @@
       for qw(get_meta_instance       compute_all_applicable_attributes
              class_precedence_list  get_method_map );
 }
+
+{
+    Foo->meta->make_immutable;
+    Bar->meta->make_immutable;
+    Bar->meta->make_mutable;
+
+    isnt( Foo->meta->get_immutable_transformer, Bar->meta->get_immutable_transformer,
+          'Foo and Bar should have different immutable transformer objects' );
+}

Modified: Class-MOP/branches/method_generation_cleanup/t/080_meta_package.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/080_meta_package.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/080_meta_package.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/081_meta_package_extension.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/081_meta_package_extension.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/081_meta_package_extension.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/082_get_code_info.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/082_get_code_info.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/082_get_code_info.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/083_load_class.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/083_load_class.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/083_load_class.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,4 +1,3 @@
-#!/usr/bin/env perl
 use strict;
 use warnings;
 use Test::More tests => 28;

Modified: Class-MOP/branches/method_generation_cleanup/t/100_BinaryTree_test.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/100_BinaryTree_test.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/100_BinaryTree_test.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/101_InstanceCountingClass_test.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/101_InstanceCountingClass_test.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/101_InstanceCountingClass_test.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/102_InsideOutClass_test.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/102_InsideOutClass_test.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/102_InsideOutClass_test.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/103_Perl6Attribute_test.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/103_Perl6Attribute_test.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/103_Perl6Attribute_test.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/104_AttributesWithHistory_test.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/104_AttributesWithHistory_test.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/104_AttributesWithHistory_test.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/105_ClassEncapsulatedAttributes_test.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/105_ClassEncapsulatedAttributes_test.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/105_ClassEncapsulatedAttributes_test.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/106_LazyClass_test.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/106_LazyClass_test.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/106_LazyClass_test.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/107_C3MethodDispatchOrder_test.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/107_C3MethodDispatchOrder_test.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/107_C3MethodDispatchOrder_test.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/108_ArrayBasedStorage_test.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/108_ArrayBasedStorage_test.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/108_ArrayBasedStorage_test.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/200_Class_C3_compatibility.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/200_Class_C3_compatibility.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/200_Class_C3_compatibility.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/300_random_eval_bug.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/300_random_eval_bug.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/300_random_eval_bug.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 
@@ -46,4 +44,4 @@
     my $c = Company->new();    
     $c->employees();
 };  
-ok($@, '... we die correctly with bad args');
\ No newline at end of file
+ok($@, '... we die correctly with bad args');

Modified: Class-MOP/branches/method_generation_cleanup/t/301_RT_27329_fix.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/301_RT_27329_fix.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/301_RT_27329_fix.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/302_modify_parent_method.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/302_modify_parent_method.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/302_modify_parent_method.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/303_RT_39001_fix.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/303_RT_39001_fix.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/303_RT_39001_fix.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 use Test::More tests => 3;

Modified: Class-MOP/branches/method_generation_cleanup/t/304_constant_codeinfo.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/304_constant_codeinfo.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/304_constant_codeinfo.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 use Test::More tests => 2;

Modified: Class-MOP/branches/method_generation_cleanup/t/305_RT_41255.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/305_RT_41255.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/305_RT_41255.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use Test::More tests => 20;
 use Test::Exception;

Added: Class-MOP/branches/method_generation_cleanup/t/306_is_class_loaded.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/306_is_class_loaded.t	                        (rev 0)
+++ Class-MOP/branches/method_generation_cleanup/t/306_is_class_loaded.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -0,0 +1,28 @@
+use strict;
+use warnings;
+
+use FindBin qw/$Bin/;
+use lib "$Bin/lib";
+
+use Test::More tests => 1;
+use Class::MOP ();
+
+# Just defining this sub appears to shit in TestClassLoaded's symbol
+# tables (see the SCALAR package symbol you end up with).
+# This confuses the XS is_class_loaded method, which looks for _any_
+# symbol, not just code symbols of VERSION/AUTHORITY etc.
+
+sub fnar {
+    TestClassLoaded::this_method_does_not_even_exist();
+}
+
+Class::MOP::load_class('TestClassLoaded');
+
+TODO: {
+    local $TODO = 'Borked';
+    ok(
+        TestClassLoaded->can('a_method'),
+        'TestClassLoader::a_method is defined'
+    );
+}
+

Added: Class-MOP/branches/method_generation_cleanup/t/header_pp.inc
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/header_pp.inc	                        (rev 0)
+++ Class-MOP/branches/method_generation_cleanup/t/header_pp.inc	2009-01-14 08:46:12 UTC (rev 7305)
@@ -0,0 +1,2 @@
+BEGIN { $ENV{CLASS_MOP_NO_XS} = 1 }
+

Added: Class-MOP/branches/method_generation_cleanup/t/lib/TestClassLoaded.pm
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/lib/TestClassLoaded.pm	                        (rev 0)
+++ Class-MOP/branches/method_generation_cleanup/t/lib/TestClassLoaded.pm	2009-01-14 08:46:12 UTC (rev 7305)
@@ -0,0 +1,8 @@
+package TestClassLoaded;
+use strict;
+use warnings;
+
+sub a_method { 'a_method' }
+
+1;
+

Modified: Class-MOP/branches/method_generation_cleanup/t/pod.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/pod.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/pod.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 

Modified: Class-MOP/branches/method_generation_cleanup/t/pod_coverage.t
===================================================================
--- Class-MOP/branches/method_generation_cleanup/t/pod_coverage.t	2009-01-14 08:43:07 UTC (rev 7304)
+++ Class-MOP/branches/method_generation_cleanup/t/pod_coverage.t	2009-01-14 08:46:12 UTC (rev 7305)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 




More information about the Moose-commits mailing list