diff options
author | Leon Timmermans <fawaka@gmail.com> | 2022-07-30 16:39:41 +0200 |
---|---|---|
committer | Leon Timmermans <fawaka@gmail.com> | 2022-11-01 10:39:16 +0100 |
commit | 3e510e80666d4b9d025e518923ae7df8b21f290e (patch) | |
tree | 321bbff632038eac3d3f18ec7feff9e85cc7ac16 /pod | |
parent | 3972099975574c30f8d639f22f1c7e0482a11aea (diff) | |
download | perl-3e510e80666d4b9d025e518923ae7df8b21f290e.tar.gz |
Add PERL_MAGIC_extvalue
A new magic type PERL_MAGIC_extvalue has been added. This is available
for use like PERL_MAGIC_ext, but is a value magic: upon localization the
new value will not be magical.
Diffstat (limited to 'pod')
-rw-r--r-- | pod/perldelta.pod | 4 | ||||
-rw-r--r-- | pod/perlguts.pod | 22 |
2 files changed, 17 insertions, 9 deletions
diff --git a/pod/perldelta.pod b/pod/perldelta.pod index f641641187..463809f73b 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -373,7 +373,9 @@ well. =item * -XXX +A new magic type C<PERL_MAGIC_extvalue> has been added. This is available for +use like C<PERL_MAGIC_ext>, but is a value magic: upon localization the new +value will not be magical. =back diff --git a/pod/perlguts.pod b/pod/perlguts.pod index a4691e6948..13417650d6 100644 --- a/pod/perlguts.pod +++ b/pod/perlguts.pod @@ -1558,8 +1558,10 @@ will be lost. constructor ] PERL_MAGIC_checkcall vtbl_checkcall Inlining/mutation of call to this CV - ~ PERL_MAGIC_ext (none) Available for use by - extensions + ^ PERL_MAGIC_extvalue (none) Value magic available for + use by extensions + ~ PERL_MAGIC_ext (none) Variable magic available + for use by extensions =for apidoc_section $magic @@ -1576,6 +1578,7 @@ will be lost. =for apidoc_item ||PERL_MAGIC_env =for apidoc_item ||PERL_MAGIC_envelem =for apidoc_item ||PERL_MAGIC_ext +=for apidoc_item ||PERL_MAGIC_extvalue =for apidoc_item ||PERL_MAGIC_fm =for apidoc_item ||PERL_MAGIC_hints =for apidoc_item ||PERL_MAGIC_hintselem @@ -1616,12 +1619,15 @@ uppercase letter is typically used to represent some kind of composite type of that composite type. Some internals code makes use of this case relationship. However, 'v' and 'V' (vec and v-string) are in no way related. -The C<PERL_MAGIC_ext> and C<PERL_MAGIC_uvar> magic types are defined -specifically for use by extensions and will not be used by perl itself. -Extensions can use C<PERL_MAGIC_ext> magic to 'attach' private information -to variables (typically objects). This is especially useful because -there is no way for normal perl code to corrupt this private information -(unlike using extra elements of a hash object). +The C<PERL_MAGIC_ext>, C<PERL_MAGIC_extvalue> and C<PERL_MAGIC_uvar> magic types +are defined specifically for use by extensions and will not be used by perl +itself. Extensions can use C<PERL_MAGIC_ext> or C<PERL_MAGIC_extvalue> magic to +'attach' private information to variables (typically objects). This is +especially useful because there is no way for normal perl code to corrupt this +private information (unlike using extra elements of a hash object). +C<PERL_MAGIC_extvalue> is value magic (unlike C<PERL_MAGIC_ext> and +C<PERL_MAGIC_uvar>) meaning that on localization the new value will not be +magical. Similarly, C<PERL_MAGIC_uvar> magic can be used much like tie() to call a C function any time a scalar's value is used or changed. The C<MAGIC>'s |