zsh-workers
 help / color / mirror / code / Atom feed
* Too much NO_UNSET?  (was Re: Weird error: opts[(r)-e]: parameter not set)
       [not found]   ` <1477827419.1556830.771655929.5F8D12AD@webmail.messagingengine.com>
@ 2016-10-30 17:45     ` Bart Schaefer
  0 siblings, 0 replies; only message in thread
From: Bart Schaefer @ 2016-10-30 17:45 UTC (permalink / raw)
  To: zsh-workers

} 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?


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-10-30 20:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1477750478.1339900.771127977.5B74E734@webmail.messagingengine.com>
     [not found] ` <161029100354.ZM4950@torch.brasslantern.com>
     [not found]   ` <1477827419.1556830.771655929.5F8D12AD@webmail.messagingengine.com>
2016-10-30 17:45     ` Too much NO_UNSET? (was Re: Weird error: opts[(r)-e]: parameter not set) Bart Schaefer

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).