develooper Front page | perl.perl5.porters | Postings from July 2016

Re: Indented here docs?

Thread Previous | Thread Next
July 10, 2016 22:29
Re: Indented here docs?
Message ID:
Matthew Horsfall (alh) wrote:
>Previously we thought ~ might be easier since we couldn't find cases
>where <<~EOF would compile, then mauke discovered one, so now ~ has
>the same problem as -.

Did he?  The closest I recall seeing is that someone noticed that
"<<~~EOF" is legal (smartmatch operator), making the "<<~" sequence a
potential subsequence of legal code.  That's vaguely interesting trivia,
but it has no impact on the present proposal, in which the "<<~" sequence
would never be followed by another tilde.

>It seems we're still up in the air about if this needs to be a feature
>or not,

It's not clashing with anything else, so no need to be a feature flag
long-term.  We're also pretty sure that there's going to be no need
to change the behaviour, and that the implementation is unproblematic,
so there's no need for it to be an experimental feature either.

>        and even if we want to get rid of bare <<.

Yes, we are.  The issue we've had finding a syntax for indented
heredocs mean that the bare << is now an actual impediment to desirable
development.  We did actually find a non-clashing syntax this time,
but there aren't many non-clashing characters left if we want to do
something similar again.

We should remove all forms of the deprecated bare << syntax, making them
unequivocal syntax errors.  (The error message could acceptably say "bare
<< has been removed", but a vanilla syntax error would also be fine.)
Because the syntax is non-clashing, this removal is logically independent
of indented heredocs.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About