From b1fb0496f553a9338443d6ecc208ae2a9cbaf1e3 Mon Sep 17 00:00:00 2001 From: lwall Date: Tue, 29 Sep 2009 21:05:11 +0000 Subject: [PATCH] [S06,S11] kill infix:, replace with statement_control: git-svn-id: http://svn.pugscode.org/pugs@28506 c213334d-75ef-0310-aa23-eaa082d1ae64 --- S06-routines.pod | 2 +- S11-modules.pod | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/S06-routines.pod b/S06-routines.pod index 8dd418442..242bed0f9 100644 --- a/S06-routines.pod +++ b/S06-routines.pod @@ -289,7 +289,7 @@ The fact that this is verbose is construed to be a feature. Alternately, you may play aliasing tricks like this: module B { - GLOBAL defines <&saith $next_id>; + import GLOBAL <&saith $next_id>; saith($next_id); # Unambiguously the global definitions } diff --git a/S11-modules.pod b/S11-modules.pod index e7b2ab5e7..63938584d 100644 --- a/S11-modules.pod +++ b/S11-modules.pod @@ -154,14 +154,14 @@ tags as arguments to C. (Of course, mixing incompatible scoping in different scopes is likely to lead to confusion.) The C declaration is actually a composite of two other declarations, -C and C. Saying +C and C. Saying use Sense ; breaks down into: need Sense; - Sense defines ; + import Sense ; These further break down into: @@ -232,18 +232,18 @@ do not automatically get imported into their surrounding scope: multi fact (Int $n) is export { [*] 1..$n } } ... - Factorial defines 'fact'; # imports the multi + import Factorial 'fact'; # imports the multi The last declaration is syntactic sugar for: BEGIN MY.import_alias(Factorial, ); -Despite having the form of an infix operator, this form functions as -a compile-time declarator, so that these notations can be combined: +This form functions as a compile-time declarator, so that these +notations can be combined by putting a declarator in parentheses: - role Silly { + import (role Silly { enum Ness is export ; - } defines ; + }) ; This really means: @@ -254,6 +254,8 @@ This really means: ); +Without an import list, C imports the C<:DEFAULT> imports. + =head1 Runtime Importation Importing via C also installs names into the current lexical scope by @@ -310,8 +312,8 @@ to the package scope instead: You may also import symbols from the various pseudo-packages listed in S02. They behave as if all their symbols are in the C<:ALL> export list: - CONTEXT defines <$IN $OUT $ERR>; - CALLER defines <$x $y>; + import CONTEXT <$IN $OUT $ERR>; + import CALLER <$x $y>; # Same as: # my ($IN, $OUT, $ERR) ::= ($*IN, $*OUT, $*ERR) @@ -381,7 +383,7 @@ For example: class Dog:auth:ver<1.2.1>; class Dog:auth:ver<1.2.1>; -Since these are somewhat unwieldy to look at, we allow a shorthand in +Since these are somewhat unweildy to look at, we allow a shorthand in which a bare subscripty adverb interprets its elements according to their form: