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

Re: unset "hash[key]" isn't matched with what "key" may be



On Tue, 09 Feb 2016 07:50:50 -0800
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> So what magic makes this work for typeset?
> 
> torch% typeset -A foo
> torch% x='['
> torch% typeset "foo[$x]"     
> zsh: not an identifier: foo[[]
> torch% typeset 'foo[$x]'		<-- note here

getindex() does parse_subcript(); later getarg() looks for tokens and if
it finds any calls singsub().  "unset" doesn't have any of this
sophistication.

pws



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