Skip Menu |
Report information
Id: 117853
Status: resolved
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: grondilu [at] yahoo.fr
masak <cmasak [at] gmail.com>
Cc:
AdminCc:

Severity: (no value)
Tag:
  • Bug
  • testcommitted
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: [BUG] can't assign here documents to constants
Date: Sat, 4 May 2013 12:17:21 +0200
To: rakudobug [...] perl.org
From: Lucien Grondin <grondilu [...] yahoo.fr>
Download (untitled) / with headers
text/plain 236b
This is perl6 version 2013.04-32-gc66c428 built on parrot 5.2.0 revision RELEASE_5_2_0 # this works: my $text = q :to 'END'; Hello world :) END say $text; # this does not: constant TEXT = q :to 'END'; Hello world :) END say TEXT;
Subject: [BUG] Cannot use constants with heredocs in Rakudo
Date: Sun, 9 Jun 2013 17:15:25 +0200
To: rakudobug [...] perl.org
From: Carl Mäsak <cmasak [...] gmail.com>
Download (untitled) / with headers
text/plain 1.7k
<masak> r: constant FOO = q:to /EOF/;␤ OH HAI␤ EOF␤␤say FOO <camelia> rakudo b2072f: OUTPUT«===SORRY!===␤Premature heredoc consumption␤» <masak> what in the world does "Premature heredoc consumption" mean? :( <masak> is it unreasonable to want to put a heredoc string in a constant? I don't think so. <jnthn> masak: It means that constants are evaluated immediately <jnthn> masak: It's the BEGIN block / heredoc thing in disguise. <masak> jnthn: I fail to understand. I know that constants evaluate immediately. but my heredocs are constant; they aren't qq strings, they're q strings. <jnthn> masak: The problem being that expression after the = up to the ; is evaluated right away at statement end <jnthn> masak: The heredoc itself hasn't been parsed at that point. <masak> ah. <jnthn> r: BEGIN say q:to /EOF/;␤ OH HAI␤ EOF␤␤say FOO <camelia> rakudo b2072f: OUTPUT«===SORRY!===␤Premature heredoc consumption␤» <jnthn> Same as there. <masak> I understand now. <masak> still dissatisfied with that semantics. <jnthn> Well, not sure what we can do about it. <jnthn> Given <jnthn> r: (BEGIN say q:to /EOF/; say 42)␤ OH HAI␤ EOF␤␤say FOO <camelia> rakudo b2072f: OUTPUT«===SORRY!===␤Premature heredoc consumption␤» <jnthn> There the BEGIN isn't even a top-level statement. <masak> feels like Perl 6 isn't doing enough for me :) <masak> we know that there is *going* to be a string there, in a very short while. <jnthn> Well, feel free to play with it to see if you can work out a sane way to make it work * jnthn isn't sure how <masak> oki. gotcha. <jnthn> I mean, I'd be happy enough with it working. I just don't see how to get there. <masak> yeah, I'm not saying it's an easy problem to solve. I'm saying it feels like it could work. * masak submits rakudobug
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 210b
<jnthn> masak: I think https://rt.perl.org/Ticket/Display.html?id=117853 can get a test (if there isnt' already one) and be closed now? <masak> jnthn: yep. was gonna add that to the ticket. * masak adds it now
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 150b
nbrown++ added a test to S02-literals/heredocs.t with commit https://github.com/perl6/roast/commit/9b7d709fd7. I'm closing this ticket as 'resolved'.


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