Author: lwall Date: 2009-09-05 20:02:42 +0200 (Sat, 05 Sep 2009) New Revision: 28193
Modified: docs/Perl6/Spec/S02-bits.pod Log: [S02] obliterate fallback from contextuals to %*ENV as a trust issue Modified: docs/Perl6/Spec/S02-bits.pod =================================================================== --- docs/Perl6/Spec/S02-bits.pod 2009-09-05 10:39:12 UTC (rev 28192) +++ docs/Perl6/Spec/S02-bits.pod 2009-09-05 18:02:42 UTC (rev 28193) @@ -13,8 +13,8 @@ Created: 10 Aug 2004 - Last Modified: 2 Sep 2009 - Version: 178 + Last Modified: 5 Sep 2009 + Version: 179 This document summarizes Apocalypse 2, which covers small-scale lexical items and typological issues. (These Synopses also contain @@ -2116,17 +2116,9 @@ is implied for variables with the C<*> twigil; hence C<$*FOO> is equivalent to C<< CONTEXT::<$*FOO> >>.) If, after scanning outward through all those dynamic scopes, there is no variable of that name -in any immediately associated lexical pad, it looks in the C<GLOBAL> -package followed by the C<PROCESS> package. If there is no such -package variable, it then looks in C<< CONTEXT::<%*ENV> >> for the -identifier of the variable, which, if not overridden in a dynamic -scope, rescans outward and eventually finds C<< PROCESS::<%*ENV> >>, -that is, in the environment variables passed to program. If the -value is not found there, it returns failure. If the variable is -of the form C<$*FOO>, the complete environment value is returned. If it -is of the form C<@*FOO> the string will be split either on colons or -semicolons as appropriate to the current operating system. Usage of -the C<%*FOO> form is currently undefined. +in any immediately associated lexical pad, it strips the C<*> twigil +out of the name and looks in the C<GLOBAL> package followed by the +C<PROCESS> package. If the value is not found, it returns failure. Unlike C<CALLER>, C<CONTEXT> will see a contextual variable that is declared in the current scope, since it starts search 0 scopes up the @@ -2155,25 +2147,6 @@ C<$*foo>, but any "hits" are ignored until we've got to the C<OUTER> scope in our traversal. -The C<CONTEXT> package is primarily for internal overriding of contextual -information, modelled on how environmental variables work among -processes. Despite the fact that the C<CONTEXT> package reflects the -current process's environment variables individually where those are not -hidden by lower-level declarations, the actual set of environment variables -that will be passed to subprocesses is taken from the C<%*ENV> variable. -Hence you must override that variable itself to influence what is -passed to subprocesses. That is, - - temp $*LANG = "ja_JP.utf8"; # WRONG - run "greet"; - -does not set the LANG environment variable for the greet program. Instead -you should make a private copy of the environment and modify that: - - temp %*ENV; - %*ENV<LANG> = "ja_JP.utf8"; # ok - run "greet"; - =item * There is no longer any special package hash such as C<%Foo::>. Just