Skip Menu |
Report information
Id: 116419
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: kevin [at] dawson10.plus.com
Cc:
AdminCc:

Severity: (no value)
Tag: Todo
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: Perl6 features out of date
Date: Wed, 16 Jan 2013 13:55:31 +0000
To: rakudobug [...] perl.org
From: kevin dawson <kevin [...] dawson10.plus.com>
Download data_blocks.p6
text/plain 218b

Message body is not shown because sender requested not to inline it.

Hi All,

ticket as requested by FROGGS

the info in -> http://perl6.org/compilers/features

relating to Lexing and Parsing - Pod implies all works,


But This is not the case

Data Blocks from - http://perlcabal.org/syn/S26.htm

Data blocks

Named Pod blocks whose typename is data are the Perl 6 equivalent of the Perl 5 __DATA__ section. The difference is that =data blocks are just regular Pod blocks and may appear anywhere within a source file, and as many times as required.

There is a corresponding variable, $=data, from which each =data block can be retrieved. $=data holds an object that does both the Associative and Positional roles.

Each =data block can be given a :key option, to name it. The contents of any =data block with a key are accessible (as a single string) via the Associative aspect of $=data object. For example:

    =begin data :key<Virtues>
    Laziness
    Impatience
    Hubris
    =end data

    say 'The three virtues are:';
    say $=data<Virtues>;

The contents of any =data block that does not have a :key are accessible (as a single string) via the Positional aspect of $=data. Unkeyed =data blocks are stored in the same order they appear in the file. For example:

    say 'The second anti_Virtue is: ', $=data[1];

    =data Industry
    =data Patience
    =data Humility

Note that, as the preceding example illustrates, because Pod is a compile-time phenomenon, it is possible to specify =data blocks after the point in the source where their contents will be used (provided they're not being used in a BEGIN, of course).

When $=data itself is stringified, it returns the concatenation of all the unkeyed =data blocks the parser has seen.

=data blocks are never rendered by the standard Pod renderers.


We Now Generate the following Output:

$ perl6 data_blocks.p6
===SORRY!===
Variable $=data is not declared
at data_blocks.p6:10
------> say $=data<Virtues>⏏;
    expecting any of:
        postfix

regards
bowtie


Download (untitled) / with headers
text/plain 241b
https://github.com/perl6/features/blob/master/features.json#L908 "status" : "r+ n+- (parsing only, no $=pod)", could be changed to "status" : "r+- n+- (parsing only, no $=pod)", regards or data blocks don't live in S26 I don't know
Download (untitled) / with headers
text/plain 138b
I'll modify the feature matrix at http://perl6.org/compilers/features to reflect the missing implementation of $=data for Pod data blocks.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org