From: Ray Andrews <rayandrews@eastlink.ca>
To: Roman Perepelitsa <roman.perepelitsa@gmail.com>
Cc: zsh-users@zsh.org
Subject: Re: (j.|.)
Date: Tue, 31 Jan 2023 13:50:29 -0800 [thread overview]
Message-ID: <8a2bb99d-9ef0-b71d-f00f-96df346abc56@eastlink.ca> (raw)
In-Reply-To: <CAN=4vMoXvu1c6KiJxUY=NC9JyMpzWg0KiDME4=57xbtwa6yMog@mail.gmail.com>
On 2023-01-31 12:19, Roman Perepelitsa wrote:
>
> Do you understand what this does?
>
> print -r -- ${(ok)parameters[(I)pa*|PA*]}
I'm afraid I don't, never seen anything like it before this. But I'd
better find out. I'm sure I've seen the pipe char. as an operator.
Alternation, no? But never in this sort of context. That would make
sense: this pattern OR that pattern. Above, obviously lower or upper
case 'pa'. Except that I can throw three or more patterns at the
command so that would require another vertical bar, no? : ... pattern1 |
pattern2 | pattern3 ... so if it only accepted two patterns I'd say
that's it for sure, but it takes more than two.
... but wait ... the 'j' ... I don't know where to read up on that ...
is it perhaps saying: 'keep on joining forever'? Again, I've never seen
it before, but if that's correct, then that's the answer -- join
everything. So then the bar in the string is in fact an operator, as I
suspected, yes? Then '(I)' matches anything in the alternation string
and feeds the correct index # into the machinery there which then grabs
the appropriate name. Sorta. Yeah, that's gotta be it. The tree I was
barking up, was that somehow the aa|bb|cc ... was being directly
converted into aa bb cc. No, the former is a huge alternation. Yes?
'j' is the power in this.
next prev parent reply other threads:[~2023-01-31 21:51 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-31 16:38 (j.|.) Ray Andrews
2023-01-31 16:41 ` (j.|.) Roman Perepelitsa
2023-01-31 16:49 ` (j.|.) Ray Andrews
2023-01-31 17:50 ` (j.|.) Ray Andrews
2023-01-31 18:10 ` (j.|.) Roman Perepelitsa
2023-01-31 19:13 ` (j.|.) Ray Andrews
2023-01-31 20:19 ` (j.|.) Roman Perepelitsa
2023-01-31 21:50 ` Ray Andrews [this message]
2023-01-31 23:33 ` (j.|.) Lawrence Velázquez
2023-02-01 0:21 ` (j.|.) Ray Andrews
2023-02-01 1:33 ` (j.|.) Lawrence Velázquez
2023-02-01 1:59 ` (j.|.) Ray Andrews
2023-02-01 2:14 ` (j.|.) Ray Andrews
2023-02-01 22:47 ` (j.|.) Ray Andrews
2023-02-02 0:43 ` (j.|.) Lawrence Velázquez
2023-02-02 1:21 ` (j.|.) 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=8a2bb99d-9ef0-b71d-f00f-96df346abc56@eastlink.ca \
--to=rayandrews@eastlink.ca \
--cc=roman.perepelitsa@gmail.com \
--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).