# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #118389]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=118389 >


<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

Reply via email to