diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-05-18 22:37:31 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-05-21 18:09:33 -0700 |
commit | bd6e6c126bf78b3ecdc6512201fd30a2c288fe7f (patch) | |
tree | fb761eab95e4a92124df9200a6622b8d151dcffb | |
parent | 5fdfd519dc37986a14b6b55f3343f6dc6db73355 (diff) | |
download | perl-bd6e6c126bf78b3ecdc6512201fd30a2c288fe7f.tar.gz |
Annihilate ‘A’ magic
How ironic! Overloading is called ‘A’ magic internally all over the
place, because of the letter used as its magic type. But now it does
not even use that magic.
I left a comment in mg_vtable.pl, so that future maintainers will have
some clue as to what AMAGIC means.
-rw-r--r-- | ext/XS-APItest/APItest.xs | 2 | ||||
-rw-r--r-- | mg_names.c | 2 | ||||
-rw-r--r-- | mg_raw.h | 4 | ||||
-rw-r--r-- | mg_vtable.h | 10 | ||||
-rw-r--r-- | pod/perlguts.pod | 119 | ||||
-rw-r--r-- | regen/mg_vtable.pl | 8 |
6 files changed, 61 insertions, 84 deletions
diff --git a/ext/XS-APItest/APItest.xs b/ext/XS-APItest/APItest.xs index e2d34d92bb..21a8c8c4ef 100644 --- a/ext/XS-APItest/APItest.xs +++ b/ext/XS-APItest/APItest.xs @@ -3438,8 +3438,6 @@ test_get_vtbl() #ifdef USE_LOCALE_COLLATE test_get_this_vtable(collxfrm); #endif - test_get_this_vtable(amagic); - test_get_this_vtable(amagicelem); test_get_this_vtable(backref); test_get_this_vtable(utf8); diff --git a/mg_names.c b/mg_names.c index 43b1945f2d..62ba922fa8 100644 --- a/mg_names.c +++ b/mg_names.c @@ -13,8 +13,6 @@ { PERL_MAGIC_symtab, "symtab(:)" }, { PERL_MAGIC_backref, "backref(<)" }, { PERL_MAGIC_arylen_p, "arylen_p(@)" }, - { PERL_MAGIC_overload, "overload(A)" }, - { PERL_MAGIC_overload_elem, "overload_elem(a)" }, { PERL_MAGIC_bm, "bm(B)" }, { PERL_MAGIC_overload_table, "overload_table(c)" }, { PERL_MAGIC_regdata, "regdata(D)" }, @@ -20,10 +20,6 @@ "/* backref '<' for weak ref data */" }, { '@', "magic_vtable_max | PERL_MAGIC_VALUE_MAGIC", "/* arylen_p '@' to move arylen out of XPVAV */" }, - { 'A', "want_vtbl_amagic", - "/* overload 'A' %OVERLOAD hash */" }, - { 'a', "want_vtbl_amagicelem", - "/* overload_elem 'a' %OVERLOAD hash element */" }, { 'B', "want_vtbl_regexp | PERL_MAGIC_READONLY_ACCEPTABLE | PERL_MAGIC_VALUE_MAGIC", "/* bm 'B' Boyer-Moore (fast string search) */" }, { 'c', "want_vtbl_ovrld", diff --git a/mg_vtable.h b/mg_vtable.h index e1622b20a5..f6d910474f 100644 --- a/mg_vtable.h +++ b/mg_vtable.h @@ -19,8 +19,6 @@ #define PERL_MAGIC_symtab ':' /* extra data for symbol tables */ #define PERL_MAGIC_backref '<' /* for weak ref data */ #define PERL_MAGIC_arylen_p '@' /* to move arylen out of XPVAV */ -#define PERL_MAGIC_overload 'A' /* %OVERLOAD hash */ -#define PERL_MAGIC_overload_elem 'a' /* %OVERLOAD hash element */ #define PERL_MAGIC_bm 'B' /* Boyer-Moore (fast string search) */ #define PERL_MAGIC_overload_table 'c' /* Holds overload table (AMT) on stash */ #define PERL_MAGIC_regdata 'D' /* Regex match position data @@ -60,8 +58,6 @@ #define PERL_MAGIC_ext '~' /* Available for use by extensions */ enum { /* pass one of these to get_vtbl */ - want_vtbl_amagic, - want_vtbl_amagicelem, want_vtbl_arylen, want_vtbl_arylen_p, want_vtbl_backref, @@ -97,8 +93,6 @@ enum { /* pass one of these to get_vtbl */ #ifdef DOINIT EXTCONST char *PL_magic_vtable_names[magic_vtable_max] = { - "amagic", - "amagicelem", "arylen", "arylen_p", "backref", @@ -153,8 +147,6 @@ EXTCONST char *PL_magic_vtable_names[magic_vtable_max]; #ifdef DOINIT EXT_MGVTBL PL_magic_vtables[magic_vtable_max] = { - { 0, Perl_magic_setamagic, 0, 0, Perl_magic_setamagic, 0, 0, 0 }, - { 0, Perl_magic_setamagic, 0, 0, Perl_magic_setamagic, 0, 0, 0 }, { (int (*)(pTHX_ SV *, MAGIC *))Perl_magic_getarylen, Perl_magic_setarylen, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, Perl_magic_freearylen_p, 0, 0, 0 }, { 0, 0, 0, 0, Perl_magic_killbackrefs, 0, 0, 0 }, @@ -201,8 +193,6 @@ EXT_MGVTBL PL_magic_vtables[magic_vtable_max]; #define want_vtbl_bm want_vtbl_regexp #define want_vtbl_fm want_vtbl_regexp -#define PL_vtbl_amagic PL_magic_vtables[want_vtbl_amagic] -#define PL_vtbl_amagicelem PL_magic_vtables[want_vtbl_amagicelem] #define PL_vtbl_arylen PL_magic_vtables[want_vtbl_arylen] #define PL_vtbl_arylen_p PL_magic_vtables[want_vtbl_arylen_p] #define PL_vtbl_backref PL_magic_vtables[want_vtbl_backref] diff --git a/pod/perlguts.pod b/pod/perlguts.pod index b5145560dd..4fe4fd5679 100644 --- a/pod/perlguts.pod +++ b/pod/perlguts.pod @@ -1048,67 +1048,64 @@ will be lost. =for mg_vtable.pl begin mg_type - (old-style char and macro) MGVTBL Type of magic - -------------------------- ------ ------------- - \0 PERL_MAGIC_sv vtbl_sv Special scalar variable - # PERL_MAGIC_arylen vtbl_arylen Array length ($#ary) - % PERL_MAGIC_rhash (none) extra data for restricted - hashes - . PERL_MAGIC_pos vtbl_pos pos() lvalue - : PERL_MAGIC_symtab (none) extra data for symbol - tables - < PERL_MAGIC_backref vtbl_backref for weak ref data - @ PERL_MAGIC_arylen_p (none) to move arylen out of - XPVAV - A PERL_MAGIC_overload vtbl_amagic %OVERLOAD hash - a PERL_MAGIC_overload_elem vtbl_amagicelem %OVERLOAD hash element - B PERL_MAGIC_bm vtbl_regexp Boyer-Moore - (fast string search) - c PERL_MAGIC_overload_table vtbl_ovrld Holds overload table - (AMT) on stash - D PERL_MAGIC_regdata vtbl_regdata Regex match position data - (@+ and @- vars) - d PERL_MAGIC_regdatum vtbl_regdatum Regex match position data - element - E PERL_MAGIC_env vtbl_env %ENV hash - e PERL_MAGIC_envelem vtbl_envelem %ENV hash element - f PERL_MAGIC_fm vtbl_regdata Formline - ('compiled' format) - G PERL_MAGIC_study vtbl_regexp study()ed string - g PERL_MAGIC_regex_global vtbl_mglob m//g target - H PERL_MAGIC_hints vtbl_hints %^H hash - h PERL_MAGIC_hintselem vtbl_hintselem %^H hash element - I PERL_MAGIC_isa vtbl_isa @ISA array - i PERL_MAGIC_isaelem vtbl_isaelem @ISA array element - k PERL_MAGIC_nkeys vtbl_nkeys scalar(keys()) lvalue - L PERL_MAGIC_dbfile (none) Debugger %_<filename - l PERL_MAGIC_dbline vtbl_dbline Debugger %_<filename - element - N PERL_MAGIC_shared (none) Shared between threads - n PERL_MAGIC_shared_scalar (none) Shared between threads - o PERL_MAGIC_collxfrm vtbl_collxfrm Locale transformation - P PERL_MAGIC_tied vtbl_pack Tied array or hash - p PERL_MAGIC_tiedelem vtbl_packelem Tied array or hash element - q PERL_MAGIC_tiedscalar vtbl_packelem Tied scalar or handle - r PERL_MAGIC_qr vtbl_regexp precompiled qr// regex - S PERL_MAGIC_sig (none) %SIG hash - s PERL_MAGIC_sigelem vtbl_sigelem %SIG hash element - t PERL_MAGIC_taint vtbl_taint Taintedness - U PERL_MAGIC_uvar vtbl_uvar Available for use by - extensions - u PERL_MAGIC_uvar_elem (none) Reserved for use by - extensions - V PERL_MAGIC_vstring vtbl_vstring SV was vstring literal - v PERL_MAGIC_vec vtbl_vec vec() lvalue - w PERL_MAGIC_utf8 vtbl_utf8 Cached UTF-8 information - x PERL_MAGIC_substr vtbl_substr substr() lvalue - y PERL_MAGIC_defelem vtbl_defelem Shadow "foreach" iterator - variable / smart parameter - vivification - ] PERL_MAGIC_checkcall vtbl_checkcall inlining/mutation of call - to this CV - ~ PERL_MAGIC_ext (none) Available for use by - extensions + (old-style char and macro) MGVTBL Type of magic + -------------------------- ------ ------------- + \0 PERL_MAGIC_sv vtbl_sv Special scalar variable + # PERL_MAGIC_arylen vtbl_arylen Array length ($#ary) + % PERL_MAGIC_rhash (none) extra data for restricted + hashes + . PERL_MAGIC_pos vtbl_pos pos() lvalue + : PERL_MAGIC_symtab (none) extra data for symbol + tables + < PERL_MAGIC_backref vtbl_backref for weak ref data + @ PERL_MAGIC_arylen_p (none) to move arylen out of XPVAV + B PERL_MAGIC_bm vtbl_regexp Boyer-Moore + (fast string search) + c PERL_MAGIC_overload_table vtbl_ovrld Holds overload table + (AMT) on stash + D PERL_MAGIC_regdata vtbl_regdata Regex match position data + (@+ and @- vars) + d PERL_MAGIC_regdatum vtbl_regdatum Regex match position data + element + E PERL_MAGIC_env vtbl_env %ENV hash + e PERL_MAGIC_envelem vtbl_envelem %ENV hash element + f PERL_MAGIC_fm vtbl_regdata Formline + ('compiled' format) + G PERL_MAGIC_study vtbl_regexp study()ed string + g PERL_MAGIC_regex_global vtbl_mglob m//g target + H PERL_MAGIC_hints vtbl_hints %^H hash + h PERL_MAGIC_hintselem vtbl_hintselem %^H hash element + I PERL_MAGIC_isa vtbl_isa @ISA array + i PERL_MAGIC_isaelem vtbl_isaelem @ISA array element + k PERL_MAGIC_nkeys vtbl_nkeys scalar(keys()) lvalue + L PERL_MAGIC_dbfile (none) Debugger %_<filename + l PERL_MAGIC_dbline vtbl_dbline Debugger %_<filename + element + N PERL_MAGIC_shared (none) Shared between threads + n PERL_MAGIC_shared_scalar (none) Shared between threads + o PERL_MAGIC_collxfrm vtbl_collxfrm Locale transformation + P PERL_MAGIC_tied vtbl_pack Tied array or hash + p PERL_MAGIC_tiedelem vtbl_packelem Tied array or hash element + q PERL_MAGIC_tiedscalar vtbl_packelem Tied scalar or handle + r PERL_MAGIC_qr vtbl_regexp precompiled qr// regex + S PERL_MAGIC_sig (none) %SIG hash + s PERL_MAGIC_sigelem vtbl_sigelem %SIG hash element + t PERL_MAGIC_taint vtbl_taint Taintedness + U PERL_MAGIC_uvar vtbl_uvar Available for use by + extensions + u PERL_MAGIC_uvar_elem (none) Reserved for use by + extensions + V PERL_MAGIC_vstring vtbl_vstring SV was vstring literal + v PERL_MAGIC_vec vtbl_vec vec() lvalue + w PERL_MAGIC_utf8 vtbl_utf8 Cached UTF-8 information + x PERL_MAGIC_substr vtbl_substr substr() lvalue + y PERL_MAGIC_defelem vtbl_defelem Shadow "foreach" iterator + variable / smart parameter + vivification + ] PERL_MAGIC_checkcall vtbl_checkcall inlining/mutation of call + to this CV + ~ PERL_MAGIC_ext (none) Available for use by + extensions =for mg_vtable.pl end diff --git a/regen/mg_vtable.pl b/regen/mg_vtable.pl index f49471bf2b..b4ed0c6dd3 100644 --- a/regen/mg_vtable.pl +++ b/regen/mg_vtable.pl @@ -25,9 +25,9 @@ my %mg = ( sv => { char => '\0', vtable => 'sv', readonly_acceptable => 1, desc => 'Special scalar variable' }, - overload => { char => 'A', vtable => 'amagic', desc => '%OVERLOAD hash' }, - overload_elem => { char => 'a', vtable => 'amagicelem', - desc => '%OVERLOAD hash element' }, + # overload, or type "A" magic, used to be here. Hence overloaded is + # often called AMAGIC internally, even though it does not use "A" + # magic any more. overload_table => { char => 'c', vtable => 'ovrld', desc => 'Holds overload table (AMT) on stash' }, bm => { char => 'B', vtable => 'regexp', value_magic => 1, @@ -135,8 +135,6 @@ my %sig = 'regexp' => {set => 'setregexp', alias => [qw(bm fm)]}, 'regdata' => {len => 'regdata_cnt'}, 'regdatum' => {get => 'regdatum_get', set => 'regdatum_set'}, - 'amagic' => {set => 'setamagic', free => 'setamagic'}, - 'amagicelem' => {set => 'setamagic', free => 'setamagic'}, 'backref' => {free => 'killbackrefs'}, 'ovrld' => {free => 'freeovrld'}, 'utf8' => {set => 'setutf8'}, |