|
From: Kevin K. <kev...@gm...> - 2025-10-21 02:31:10
|
On Mon, Oct 20, 2025 at 7:22 PM EricT <tw...@gm...> wrote:
> You're right that {=}{expression} avoids this particular incompatibility. I think {=} could potentially work, though my sense is it would require more extensive parser changes to handle quotes and bare words (where $ already works naturally). But I could be wrong about the implementation complexity.
>
>
The parser changes are pretty minimal, and nearly parallel to the
implementation of {*}. The {=} would be presumed to be followed by a
'word', with all the usual rules that implies.
{=}{$a + $b} would be parsed by the ordinary balancing of curly braces,
followed by processing the content as an expression.
{=}[command], {=}"quoted string", {=}$var, etc, would all have natural
meanings equivalent to applying [expr] to the substituted value.
(Ordinarily, those uses should be advised against, since all these forms
ask for double substitution and invite code injection attacks, but I can
see them having their place in some specialized contexts, and the syntax is
thereby rendered uniform.)
(I'd actually favor {$} over {=}, and instead reserve {=} for the
possibility of a new 'little language' for less cumbersome expressions (in
particular, automatic $-substitution of barewords, and implementation of =
for assignment. But that's a different idea altogether, and has had several
rejected or abandoned TIPs over the years.)
--
73 de ke9tv/2, Kevin
|