Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [doogie@xxxxxxxxxx: Bug#163391: unset array[key] where key is non-existent doesn't fail]
- X-seq: zsh-workers 17774
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- To: Clint Adams <clint@xxxxxxx>, zsh-workers@xxxxxxxxxx
- Subject: Re: [doogie@xxxxxxxxxx: Bug#163391: unset array[key] where key is non-existent doesn't fail]
- Date: Sat, 5 Oct 2002 19:52:09 +0000
- Cc: 163391-forwarded@xxxxxxxxxxxxxxx
- In-reply-to: <20021005173125.GA24695@xxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20021005173125.GA24695@xxxxxxxx>
On Oct 5, 1:31pm, Clint Adams wrote:
}
} I'm not sure to what "contract" he's referring, but SUSv3 says
}
} Unsetting a variable or function that was not previously set shall not
} be considered an error and does not cause the shell to abort.
}
} and that unset should return a >0 exit status if any of the "name"
} operands cannot be unset.
}
} Of course, it knows nothing about associative arrays.
Exactly. The variable "aarray" WAS previously set (by "declare -A").
The fact that a particular hash key was not assigned-to is irrelevant.
zsh -c 'typeset non_existant_var;
unset non_existant_var && echo consistent || echo inconsistent'
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
Messages sorted by:
Reverse Date,
Date,
Thread,
Author