Changeset 16740 for docs/Perl6/Spec
- Timestamp:
- 06/26/07 18:35:43 (17 months ago)
- Files:
-
- 1 modified
-
docs/Perl6/Spec/Documentation.pod (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
docs/Perl6/Spec/Documentation.pod
r16035 r16740 21 21 Maintainer: Damian Conway 22 22 Date: 9 Apr 2005 23 Last Modified: 19 Feb200723 Last Modified: 25 Apr 2007 24 24 25 25 … … 98 98 After the typename, the rest of the C<=begin> marker line is treated as 99 99 configuration information for the block. This information is used in 100 different ways by different types of blocks, and is specified using 101 Perl6ish C<:key<value>> or C<< key=>value >> pairs (which must, of 102 course, be constants since Perldoc is a specification language, not a 103 programming language). 100 different ways by different types of blocks, but is always specified using 101 Perl6-ish option pairs. That is, any of: 102 103 =for table :nested 104 Value is... Specify with... Or with... Or with... 105 =============== ================== ============== ====================== 106 Boolean (true) C�:key� C�:key(1)� C�key => 1� 107 Boolean (false) C�:!key� C�:key(0)� C�key => 0� 108 String C�:key<str>� C�:key('str')� C�key => 'str'� 109 List C�:key<1 2 3>� C�:key[1,2,3]� C�key => [1,2,3]� 110 Hash C�:key{a=>1, b=>2}� C�key => {a=>1, b=>2}� 111 Code C�:key{ sqrt($_) }� 112 113 All option keys and values must, of course, be constants since Perldoc 114 is a specification language, not a programming language. 104 115 See L<Synopsis 2|http://dev.perl.org/perl6/doc/design/syn/S02.html#Literals> 105 for a summary of the Perl 6 pair notation.116 for details of the various Perl 6 pair notations. 106 117 107 118 The configuration section may be extended over subsequent lines by … … 109 120 whitespace character. 110 121 111 The lines following the opening delimiter and configuration are the data 112 or contents of the block, which continue until the block's C<=end> marker 113 line. The general syntax is: 122 The lines following the opening delimiter and configuration are the 123 data or contents of the block, which continue until the block's C<=end> 124 marker line. For most block types, these contents may be indented if you 125 wish, without them being treated as L<code blocks|#Code blocks>. Unlike 126 Perl 5, indented text is only treated as code within C<=pod>, 127 L<C<=nested>|#Nesting blocks>, L<C<=item>|#Lists>, C<=code>, and 128 L<semantic|#Semantic blocks> blocks. 129 130 The general syntax is: 114 131 115 132 =begin code :allow< R > … … 255 272 256 273 =begin para :nested 257 =begin para :nested258 =begin para :nested274 =begin para :nested 275 =begin para :nested 259 276 "We're going deep, deep, I<deep> undercover!" 260 277 =end para … … 501 518 =head2 This is another heading block 502 519 503 Within a C<=pod>, C<=item>, C<=nested>, or C<=END> block, ordinary 504 paragraphs do not require an explicit marker or delimiters, but there is 505 also an explicit C<para> marker (which may be used anywhere): 520 Within a C<=pod>, C<=item>, C<=nested>, C<=END>, or 521 L<semantic|#Semantic blocks> block, ordinary paragraphs do not require 522 an explicit marker or delimiters, but there is also an explicit C<para> 523 marker (which may be used anywhere): 506 524 507 525 =for code :allow<B> … … 513 531 and likewise the longer C<=for> and C<=begin>/C<=end> forms. For example: 514 532 515 = forcode :allow<B>533 =begin code :allow<B> 516 534 B<=begin para> 517 535 This is an ordinary paragraph. 518 536 Its text will be squeezed and 519 537 short lines filled. 538 539 This is I<still> part of the same paragraph, 540 which continues until an... 520 541 B<=end para> 542 =end code 521 543 522 544 As the previous example implies, when any form of explicit C<para> block 523 545 is used, any whitespace at the start of each line is removed, so 524 the paragraph text no longer has to begin at column 1. 546 the paragraph text no longer has to begin at column 1. In addition, 547 within a delimited C<=begin para>/C<=end para> block, any blank lines are 548 preserved. 525 549 526 550 … … 547 571 548 572 Implicit code blocks may only be used within C<=pod>, C<=item>, 549 C<=nested>, or C<=END> blocks.573 C<=nested>, C<=END>, or L<semantic|#Semantic blocks> blocks. 550 574 551 575 There is also an explicit C<=code> block (which can be specified within … … 640 664 641 665 Unlike C<=code> blocks, both C<=input> and C<=output> blocks honour any 642 nested formatting codes. This is particular useful since a sample of666 nested formatting codes. This is particularly useful since a sample of 643 667 input will often include prompts (which are, of course, output). 644 668 Likewise a sample of output may contain the occasional interactive
