Author: wayland Date: 2009-03-02 06:51:23 +0100 (Mon, 02 Mar 2009) New Revision: 25651
Modified: docs/Perl6/Spec/S28-special-names.pod Log: S28: - Did more heading changes to make it "Special Names" instead of "Special Variables" - Added lots of spec cross-references - Added a $*DISTRO variable (hopefully this was just an omission) - Added a SoftwarePackage class that represents the name and version of the software mentioned, whether this be Perl, and OS, or a Distro. Modified: docs/Perl6/Spec/S28-special-names.pod =================================================================== --- docs/Perl6/Spec/S28-special-names.pod 2009-03-02 05:29:37 UTC (rev 25650) +++ docs/Perl6/Spec/S28-special-names.pod 2009-03-02 05:51:23 UTC (rev 25651) @@ -11,8 +11,10 @@ Last Modified: 25 Feb 2009 Version: 5 -=head1 Introduction +=head1 Special Variables +=head2 Introduction + This document serves as a collection point for what is known about special variables in Perl 6 and correlates them with the changes from Perl 5. @@ -23,9 +25,9 @@ Perl 5 variable(s). The list of main entries is also followed by a table showing the 5 and 6 variables side-by-side. -=head1 Overview +=head2 Overview -=head2 Secondary Sigils (also known as "twigils") +=head3 Secondary Sigils (also known as "twigils") A quick reminder of the relevant twigils from S02: @@ -56,7 +58,7 @@ rather than compiler control. The structure of these variables will be fleshed out in S26. -=head2 Named variables +=head3 Named variables Variable Spec Type Description -------- ---- ---- ----------- @@ -68,44 +70,45 @@ @*ARGS S06 Array of Str # command-line arguments $*ARGFILES S02 IO # The magic command-line input handle &?BLOCK S06 Block # current block (itself) - ::?CLASS Str # current class (as package or type name) - $?CLASS Class # current class - @=COMMENT # All the comment blocks in the file - %?CONFIG Hash of XXX # configuration hash - $=DATA # data block handle (=begin DATA ... =end) - @=DATA # Same as above, but array + ::?CLASS S12 Str # current class (as package or type name) + $?CLASS S02 Class # current class + @=COMMENT (S26) # All the comment blocks in the file + %?CONFIG Hash of XXX # configuration hash XXX What does this do? + $=DATA (S26) IO # data block handle (=begin DATA ... =end) + @=DATA (S26) Array # Same as above, but array %?DEEPMAGIC S13 Hash of XXX # Controls the mappings of magical names to sub definitions - $?DISTRO S02 Str # Which OS distribution am I compiling under + $?DISTRO S02 SoftwarePackage # Which OS distribution am I compiling under + $*DISTRO SoftwarePackage # Which OS distribution am I running under $*EGID Int # effective group id - %*ENV Hash of Str # system environment variables + %*ENV S02 Hash of Str # system environment variables $*ERR S16 IO # Standard error handle $*EUID Int # effective user id $*EXECUTABLE_NAME Str # executable name - $?FILE Str # current filename of source file - $?GRAMMAR Grammar # current grammar + $?FILE S02 Str # current filename of source file + $?GRAMMAR S02 Grammar # current grammar $*GID Int # group id $*IN S16 IO # Standard input handle; is an IO object $*INC S11 # where to search for user modules (but not std lib!) $?LANG S02 # Which Perl parser should embedded closures parse with? $*LANG S02 Str # LANG variable from %*ENV that defines what human language is used - $?LINE Int # current line number in source file + $?LINE S02 Int # current line number in source file %*META-ARGS S19 Hash of XXX # Meta-arguments - $?MODULE Module # current module + $?MODULE S02 Module # current module %*OPTS S19 Hash of XXX # Options from command line %*OPT... S19 Hash of XXX # Options from command line to be passed down - $?OS Str # operating system compiled for - $*OS Str # operating system running under + $?OS SoftwarePackage # operating system compiled for + $*OS SoftwarePackage # operating system running under $*OUT S16 IO # Standard output handle $?PARSER S02 Grammar # Which Perl grammar was used to parse this statement? - $?PACKAGE Package # current package - $?PERL S02 Str # Which Perl am I compiled for? - $*PERL Str # perl version running under + $?PACKAGE S02 Package # current package + $?PERL S02 SoftwarePackage # Which Perl am I compiled for? + $*PERL S02 SoftwarePackage # perl version running under $*PID Int # system process id %=POD S02 # (or some such) - $*PROGRAM_NAME Str # name of the Perl program being executed + $*PROGRAM_NAME S19 Str # name of the Perl program being executed %*PROTOCOLS S16 Hash of Method # Stores the methods needed for the uri() function ::?ROLE Str # current role (as package or type name) - $?ROLE Role # current role + $?ROLE S02 Role # current role &?ROUTINE S06 Routine # current sub or method (itself) $?SCOPE S02 # Current "my" scope (XXX unnecessary?) $*UID Int # system user id @@ -123,15 +126,19 @@ to called code. Likewise each thread could log its own errors to its own C<$*ERR>, since a thread is a dynamic scope. -=head1 Special Variables +=head2 Special Classes -This section only lists variables that don't have a "See S16" or suchlike next to them in -the overview above. +These are classes defined especially for the benefit of the Special Variables. -XXX Some of the information here is either old, or needs to be moved elsewhere. XXX + class SoftwarePackage { + has Str $name; + has Version $version; + } -=head2 Perl5 to Perl6 special variable translation +This class is intended to represent a software package at a fairly basic level. +=head3 Perl5 to Perl6 special variable translation + If a column has a "-" in it, it means that item is unavailable in that version of Perl. Perl 5 Perl 6 Comment @@ -207,7 +214,7 @@ $SIG{__DIE__} $*ON_DIE ${^OPEN} - This was internal; forget it -=head1 NOT YET DEFINED +=head2 NOT YET DEFINED The following items are not yet defined, but will need to be defined. @@ -218,7 +225,7 @@ The $?LANG and $*LANG variables are also confusing (both in S02). -=head2 Form.pm +=head3 Form.pm These go in the Perl5 to Perl6 conversion table: @@ -247,12 +254,12 @@ - $^A $ACCUMULATOR -=head2 S15-unicode.pod +=head3 S15-unicode.pod ${^ENCODING} variable -- S32/Str.pod implies this is $*ENC ${^UNICODE} variable -=head2 Infectious trait spec +=head3 Infectious trait spec ${^TAINT} variable, which is pending, among other things, infectious trait spec