Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Too much NO_UNSET? (was Re: Weird error: opts[(r)-e]: parameter not set)
- X-seq: zsh-workers 39785
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Too much NO_UNSET? (was Re: Weird error: opts[(r)-e]: parameter not set)
- Date: Sun, 30 Oct 2016 10:45:30 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=NDXhvhdg0NpnpOqabPJ22XTvC9N1xU7vkZ8LYzMHNmA=; b=v3tr+eKcBmnXvmj7K74dGaCgCI8CVotcba+mAJLzuuVtiV4PGwGM5HddFLBEI4koSl OPOeQAH4/sDjgLf4gN5qxba8BM47a6rg7RV5gXXZBQzQYar9/rrc1DGV5xtA/FWF4Wx/ 7pI0c3o6wVykm29qo7sBAibJSv/ZyZPhIG4on4j5Z5U4YxLcm50D6hj8zolDhJVoFS38 T0tgHIGkjpL5vnNWFCbs3LX0hRDQEzGhKNt8MwKqPtt06IwlnzLfWXHbmg9X3gYDkpfS emVEkxIt3Q9fshSE2f2upBSibfeI7kpSXo5iPoRD3xBnuANV/b7PoYyRUikNmWshiDp3 wzJQ==
- In-reply-to: <1477827419.1556830.771655929.5F8D12AD@webmail.messagingengine.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <1477750478.1339900.771127977.5B74E734@webmail.messagingengine.com> <161029100354.ZM4950@torch.brasslantern.com> <1477827419.1556830.771655929.5F8D12AD@webmail.messagingengine.com>
} On Sat, Oct 29, 2016, at 10:03 AM, Bart Schaefer wrote:
} > The NO_UNSET option complains not just when the array itself is not
} > declared, but whenever there is a dereference of an array element
} > that does not exist.
I wonder if NO_UNSET is a little too aggressive. For example, the following
does not seem particularly desirable:
torch% () { setopt nounset; echo $3 }
(anon): 3: parameter not set
I'm undecided on whether array elements in general should be protected from
the warning if the array itself is set, or only the positional parameters
need special handling. On the other hand, I can see it being quite useful
to get the warning for *associative* array elements that aren't set.
Discuss?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author