Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH (not final)] (take three?) unset "array[$anything]"

On Sat, Jun 5, 2021 at 11:18 AM Peter Stephenson
<p.w.stephenson@xxxxxxxxxxxx> wrote:
> On Fri, 2021-06-04 at 12:25 -0700, Bart Schaefer wrote:
> > On Thu, Jun 3, 2021 at 7:42 AM Peter Stephenson
> > <p.w.stephenson@xxxxxxxxxxxx> wrote:
> > >
> > > assemble a table of how they're handled now and with the
> > > two most promising proposed fixes.
> >
> > Are the samples I posted in workers/49005 adequate?
> Looks very much like what's needed.  Thanks.

How do we make the call on what to do, then?

There are a total of 29 test cases where at least one combination
(bare current shell, current shell with Stephane's workaround, and
stripquote or literal with the workaround) fails on the test key.  (31
appear in 49005 but two of the test cases are redundant, which I
hadn't noticed before.)

Considering only the 3 variants with the workaround, literal misses 5
of the same cases as the current shell, but 9 additional cases.
Stripquote misses only one of the same cases as the current shell but
also only 5 additional cases.  The current shell (w/workaround) misses
4 cases that neither of the other two miss.

The cases literal fails on are, as might be expected, those in which
the workaround adds extra backslashes.  Stripquote works for most of
those because it peels the extra backslash off again ... but that's
exactly the behavior which Stephane points out "otherwise serves no

I still feel literal is the best option despite potentially breaking
more workarounds, because it means the workarounds can just be removed
rather than modified.

Messages sorted by: Reverse Date, Date, Thread, Author