zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Ray Andrews <rayandrews@eastlink.ca>
Cc: zsh-users@zsh.org
Subject: Re: tilde syntax
Date: Fri, 5 Jan 2024 16:23:20 -0800	[thread overview]
Message-ID: <CAH+w=7ZZGTkDMnOU2hhQdtXfPHZSLV6=eeBi1iqYn03qCF0q9A@mail.gmail.com> (raw)
In-Reply-To: <b36d7bd3-18ed-4baf-acee-270664335eb2@eastlink.ca>

On Fri, Jan 5, 2024 at 3:47 PM Ray Andrews <rayandrews@eastlink.ca> wrote:
>
> On 2024-01-05 15:27, Bart Schaefer wrote:
>
> On Fri, Jan 5, 2024 at 2:50 PM Ray Andrews <rayandrews@eastlink.ca> wrote:
>
> There really isn't any "parsing" per se -- internally, an "active"
> pattern character is represented differently than its literal
> counterpart.
>
> No way to see that unfold?

I don't even know what that would mean.  It's like asking to see
strcpy() "unfold."  The only difference is that when say a "*" is in
in the input, a different byte is put into the "active" output.
Instrumenting that for casual observability would be stupidly slow in
the normal use case.

> I'd advocate for clear and *visible* ways of coding one or the other.

But that's just it:  The base case in zsh is that if you CAN see it
(and you don't see quotes around it) then it IS active, and if you
CAN'T see it (or you do see quotes) then it's literal.  The only time
you need to get fancy is when you've deliberately hidden something
("inside" a parameter) and you need to expose it.  In most shells
other than zsh the patterns are active whether you can see them or
not, unless you see quotes, which means you see a lot of quotes.  The
corollary to the base case is that parameter references expand in
double quotes but not in single quotes, but expanding does not mean
making the contents active.

> "One of the endless problems with zsh -- or any other shell -- is that there are places where entered characters are presumed to be literal -- but can be forced to indicate some action or command -- and other places where entered characters are presumed to be actions -- but can be forced to become literal characters."

That's close to a complete mischaracterization.  Or conversely, it's
true of every programming language, just with differences of syntax.


  reply	other threads:[~2024-01-06  0:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-04 22:31 Ray Andrews
2024-01-04 22:49 ` Bart Schaefer
2024-01-04 23:04   ` Ray Andrews
2024-01-04 23:40     ` Lawrence Velázquez
2024-01-05  0:12       ` Ray Andrews
2024-01-05  1:41         ` Lawrence Velázquez
2024-01-05  2:03           ` Ray Andrews
2024-01-05 14:41             ` Mark J. Reed
2024-01-05 16:42               ` Ray Andrews
2024-01-05 19:58                 ` Bart Schaefer
2024-01-05 22:50                   ` Ray Andrews
2024-01-05 23:27                     ` Bart Schaefer
2024-01-05 23:47                       ` Ray Andrews
2024-01-06  0:23                         ` Bart Schaefer [this message]
2024-01-06  3:44                           ` Ray Andrews

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7ZZGTkDMnOU2hhQdtXfPHZSLV6=eeBi1iqYn03qCF0q9A@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=rayandrews@eastlink.ca \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).