__END__ in PIR

Will Coleda will at coleda.com
Wed Dec 2 13:56:36 UTC 2009


On Wed, Dec 2, 2009 at 8:03 AM, Andrew Whitworth <wknight8111 at gmail.com> wrote:
> I'm inclined to say "yes", but really it's part of a larger set of PIR
> language features we might want to look into:
>
> 1) The ability to say where the PIR code starts, so we can provide a
> separate stub header ("perl -x")
> 2) The ability to say where the PIR code ends, so we can include other
> information in the file thereafter ("__END__")
> 3) The ability to get access to the information in the file after the
> __END__ ("<DATA>" and "__DATA__" In perl5)
>
> Any of these features alone would be nice but not necessary. Together
> I think they open up a lot of flexibility. I would, however, prefer to
> use something more PIR-ish than "__END__", maybe ".endfile" instead.
>
> --Andrew Whitworth

I'm inclined to say no; these have to spec'd against how they interact
with .include, and, IMO, don't make sense for the low level PIR - too
much complexity, not enough gain.

- for an example of how this can fail with .include; , put a =head1
directive (with no =cut) in an included file.[0]
- We already have pod directives to have sections of non-code (Bonus:
these sections can go anywhere, not just at the end.)
- What format would the data in a perl-style __DATA__ block be? a
binary string? Where in the bytecode would it be stored? (for
alternatives, see .const subs and heredocs; this preloading of data
can already be accomplished)
- Would we need to (not?) support this inside PASM? what about compreg 'PIR' ?

Regards.

[0] {{This is especially fun with multiple .includes where there is a
=cut later on.}}


>
> On Tue, Dec 1, 2009 at 11:30 PM, Jonathan Leto <jaleto at gmail.com> wrote:
>> Howdy,
>>
>> Do we want __END__ in PIR?
>>
>> https://trac.parrot.org/parrot/ticket/1118
>>
>> Duke
>>
>> --
>> Jonathan "Duke" Leto
>> jonathan at leto.net
>> http://leto.net
>> _______________________________________________
>> http://lists.parrot.org/mailman/listinfo/parrot-dev
>>
> _______________________________________________
> http://lists.parrot.org/mailman/listinfo/parrot-dev
>



-- 
Will "Coke" Coleda


More information about the parrot-dev mailing list