[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: setarray[unsetkey] doesn't trigger nounset in arithmetic context
From: |
Greg Wooledge |
Subject: |
Re: setarray[unsetkey] doesn't trigger nounset in arithmetic context |
Date: |
Sun, 21 May 2023 18:15:29 -0400 |
On Mon, May 22, 2023 at 07:01:18AM +1000, Martin D Kealey wrote:
> [...] and treating "unset" as a fatal error is not the experience that
> programmers have using other scripting languages, and is therefore, I would
> argue, not something that should be added to the Shell, and certainly not
> as a quiet change to the existing `set -u`.
Just for the record, Tcl's unset command generates an error if you use
it on a nonexistent variable (which includes a nonexistent array
element). But it also offers a -nocomplain option, which you may use
if you want to unset something that may or may not currently exist.
(End tangent.)
Re: setarray[unsetkey] doesn't trigger nounset in arithmetic context, Chet Ramey, 2023/05/22