zsh-workers
 help / color / mirror / code / Atom feed
* Request about unhash / unfunction / unset
@ 2015-03-23 21:06 Larry Schrof
  2015-03-23 21:40 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Larry Schrof @ 2015-03-23 21:06 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 587 bytes --]

I would like to humbly request that if zsh is asked to unhash an entry that is not in the hash table, it silently does nothing if the entry was not previously there. (Instead of generating an error message.)

I think in the vast majority of use cases, the user just wants to ensure an element is not in the hash table. I don't think they care if it was or wasn't in the table before the call to unhash. And the operation is idempotent, so there's even less motivation to warn based on the initial state.

Same request for unfunction and unalias.

Thanks for your consideration!


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Request about unhash / unfunction / unset
  2015-03-23 21:06 Request about unhash / unfunction / unset Larry Schrof
@ 2015-03-23 21:40 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2015-03-23 21:40 UTC (permalink / raw)
  To: zsh-workers

On Mon, 23 Mar 2015 21:06:26 +0000
Larry Schrof <larrys@fb.com> wrote:
> I would like to humbly request that if zsh is asked to unhash an entry
> that is not in the hash table, it silently does nothing if the entry
> was not previously there. (Instead of generating an error message.)

In fact, unset already works like that: we changed it because that's
what the standard requires.  So it might make sense to be consistent.

I see bash is silent with "unset -f" which is unfunction but not
"unalias".

pws


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-23 21:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-23 21:06 Request about unhash / unfunction / unset Larry Schrof
2015-03-23 21:40 ` Peter Stephenson

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