develooper Front page | perl.perl5.porters | Postings from June 2022

Re: pre-RFC: template strings

Thread Previous | Thread Next
From:
Ricardo Signes
Date:
June 18, 2022 00:12
Subject:
Re: pre-RFC: template strings
Message ID:
b6ef0ba7-9ff5-4ba8-9555-9d2dfd78c2ba@www.fastmail.com
On Wed, Jun 15, 2022, at 11:27, Philippe Bruhat (BooK) wrote:
> I like having different forms for explicitely providing context. If there is a single form (like the suggested `#{}`), then it probably should provide list context (since we only have the `scalar` keyword at our disposal).

I disagree, we also have "join", and I would suggest people use that to get a string form for a list.  It lets us say that…
qt{This is #{$how_cool} cool.}

…is equivalent to…
q{This is } . ($how_cool) . q{ cool.}

I'm not strongly opposed to two forms, but I think that qt should be a compelling replacement for "..." in many or most cases, so interpolating simple things shouldn't feel like a chore.  (I think that {...} might even be better than #{...}.)

-- 
rjbs
Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About