develooper Front page | perl.perl5.porters | Postings from August 2016

Re: Internals:: undocumented

Thread Previous | Thread Next
From:
demerphq
Date:
August 6, 2016 13:39
Subject:
Re: Internals:: undocumented
Message ID:
CANgJU+Wb7nV5RPaacvr8u=RxxUqfzvNsYNbwnQhRzyP_jnLHow@mail.gmail.com
Internals is a namespace that exists to hold functions that violate the
abstraction model of Perl and allow one to access or set internal property
bits of a variable.  Some of its functions are mentioned in the docs,  some
not.  Afaik the full list can be found in universal.c along with all the
other special built in namespaces, such as re and Hash::Util.

Often the functions are used for introspecting or overriding the internals
of variables in tests or 'I know what I am doing'  scenarios.

I don't know that we should be documenting the Internals namespace
explicitly. In theory any and all of it is use at your own risk and subject
to revision in future perls.

Yves

On 6 Aug 2016 15:05, "James E Keenan" <jkeen@verizon.net> wrote:

$ ack -l 'Internals::' .
perl.c
dist/Storable/t/restrict.t
dist/constant/lib/constant.pm
dist/threads-shared/t/clone.t
dist/threads-shared/lib/threads/shared.pm
dist/Module-CoreList/lib/Module/CoreList.pm
ext/Hash-Util/t/Util.t
ext/Hash-Util/lib/Hash/Util.pm
ext/PerlIO-scalar/t/scalar_ungetc.t
cpan/Scalar-List-Utils/t/reduce.t
cpan/Scalar-List-Utils/t/first.t
MANIFEST
pod/perl5220delta.pod
universal.c
configpm
t/porting/bincompat.t
t/re/subst.t
t/re/qr-72922.t
t/op/eval.t
t/op/tie.t
t/op/sort.t
t/op/gv.t
t/op/inccode.t
t/op/ref.t
t/op/sselect.t
t/op/sub_lval.t
t/lib/universal.t
lib/Module/CoreList.pm
lib/Config_heavy.pl
lib/utf8.t
lib/Internals.t
lib/constant.pm
lib/threads/shared.pm
lib/Hash/Util.pm

But AFAICT nowhere in these files is 'Internals::' documented.  I merely
wished to add some descriptions to tests currently lacking them.  But some
of these tests call what looks like a function from a package called
'Internals' on variables, e.g.:

lib/Internals.t:17:ok( !Internals::SvREADONLY $foo );

What is Internals?

Thank you very much.
Jim Keenan

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About