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

Re: [PATCH] (final) unset "array[$anything]"



On 6/14/21, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> Here's the diff just for "literal" unset, omitting all the
> alternatives and omitting the problematic hunk that modified getasg().
>
> I've included a NEWS entry, but have not yet attempted to create an
> incompatibilities section for README since it's not clear what the
> next zsh version number will be.

+that result as the exact hash element to unset.  This differs from previous
+versions of the shell, which would also remove a leading backslash for an
+unusual subset of characters in the expansion of $key.  Note this also
+means, for example, that
+  unset 'hash[ab]cd]'
+unsets the element with key "ab]cd" rather than silently doing nothing.

It is somewhat unclear (without using my contextual knowledge) if the
"Note this" applies to the old or the new behavior. Perhaps "Note
this" can be replaced explicitly with "Note that the new behaviour" or
so. (or "unsets" on the last line could become "now unsets".)

-- 
Mikael Magnusson




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