[prev in list] [next in list] [prev in thread] [next in thread]
List: perl5-porters
Subject: Re: q, qq and qx here-documents (for consistency with qt here-docs)
From: David Nicol <davidnicol () gmail ! com>
Date: 2024-01-26 2:55:40
Message-ID: CAFwScO8V+-ZPg4cT_eJfHfKT7iUW78W3hQSV25afvTMfUPTc_A () mail ! gmail ! com
[Download RAW message or body]
there's also Tie::Function, mine on CPAN, which lets you call the sub tied
to the hash using hash syntax, which interpolates.
It's very handy for URL-encoding and such
On Sat, Jan 20, 2024 at 12:33 AM Branislav Zahradník <happy.barney@gmail.com>
wrote:
>
>
> On Sat, 20 Jan 2024 at 07:14, David Nicol <davidnicol@gmail.com> wrote:
>
>> oh. I don't like it. We already have ways to interpolate arbitrary code
>> into qq strings, including regex text, by doing stuff like
>>
>>
>> my $bracketed_foo = "{@{[foo()]}}";
>>
>> of course that's kind of a "leaning toothpick syndrome" way to do things
>> but the feature strikes me as gratuitous complexity.
>>
>> dln
>>
>>
> depends on implementation
> - qt is focused on scalars to replace pattern ${\ ...) with ${ }
> - qt has a chance to eliminate nested escaping (like for example
> javascript template literals does)
>
> My main concern is that qt is allowed alongside interpolated strings, so
> they can be mixed together.
> For consistency of language and maintainability of code base in long time
> I believe it has to be feature
> affecting interpolation string in whole context where feature is on.
>
> Code like this shouldn't be allowed:
> my $foo = qt ( ${ ${\ foo } })
>
> Brano
>
>
>
>
--
"Lay off that whiskey, and let that cocaine be!" -- Johnny Cash
[Attachment #3 (text/html)]
<div dir="ltr">there's also Tie::Function, mine on CPAN, which lets you call the \
sub tied to the hash using hash syntax, which \
interpolates.<div><br></div><div>It's very handy for URL-encoding and \
such</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On \
Sat, Jan 20, 2024 at 12:33 AM Branislav Zahradník <<a \
href="mailto:happy.barney@gmail.com">happy.barney@gmail.com</a>> \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div \
dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On \
Sat, 20 Jan 2024 at 07:14, David Nicol <<a href="mailto:davidnicol@gmail.com" \
target="_blank">davidnicol@gmail.com</a>> wrote:<br></div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div dir="ltr">oh. I don't like it. We already \
have ways to interpolate arbitrary code into qq strings, including regex text, by \
doing stuff like<div><br></div><div><br></div><div> my $bracketed_foo = \
"{@{[foo()]}}";</div><div><br></div><div>of course that's kind of a \
"leaning toothpick syndrome" way to do things but the feature strikes me as \
gratuitous complexity.</div><div><br></div><div>dln</div><div><br></div></div></blockquote><div><br></div><div>depends \
on implementation</div><div>- qt is focused on scalars to replace pattern ${\ ...) \
with ${ }</div><div>- qt has a chance to eliminate nested escaping (like for example \
javascript template literals does)</div><div><br></div><div>My main concern is that \
qt is allowed alongside interpolated strings, so they can be mixed \
together.</div><div>For consistency of language and maintainability of code base in \
long time I believe it has to be feature</div><div>affecting interpolation string in \
whole context where feature is on.</div><div><br></div><div>Code like this \
shouldn't be allowed:</div><div>my $foo = qt ( ${ ${\ foo } \
})<br></div><div><br></div><div>Brano<br></div><br></div><div \
class="gmail_quote"><br></div><div class="gmail_quote"><br></div></div> \
</blockquote></div><br clear="all"><div><br></div><span \
class="gmail_signature_prefix">-- </span><br><div dir="ltr" \
class="gmail_signature"><div dir="ltr"><font face="times new roman, serif">"Lay \
off that whiskey, and let that cocaine be!" -- Johnny \
Cash</font><br></div></div>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic