Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: When local state_descr is needed?
- X-seq: zsh-workers 38640
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: zsh workers <zsh-workers@xxxxxxx>
- Subject: Re: When local state_descr is needed?
- Date: Thu, 09 Jun 2016 16:43:44 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1465483425; bh=99zG7S6XXQIRKoZh7uICKo6F40qFtB6tnVBt8a+CN/w=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=kLzOFLfJz2W4PR4OOTyk3qQAIK5UFSZxcuJFwaq8J2Ytcr0C53wm1k9vuVzfJpRpdK3TnJE35Z7rHffHTtLu55IrU1VnjP78ugA5oZcRKmEFq4QPbyqv5VeeiIXBZuWGUZ/jsMboyHzpWMzwOvur6fc6ZqfmNBelvq/xX6C5pKJ8a1ad44PSiMNpTBXM7rQXgPbR/c7RNcYD3AhOC+fzOORhNWYhdTkWaKbtwwnFFXpq0IYDgW+nv3YEBE2l8hemfgWwnBAr0Ge0/+3ef7nuPkS9q/gRt63oiLEFwVYaxXjcJDnrvBOrYvldTuDXWB1oXhOjCa7XDF0Q6I1aX3r8Yg==
- In-reply-to: <57593D7F.40604@redhat.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: <57593D7F.40604@redhat.com>
Marko Myllynen wrote:
>
> It's a bit unclear to me when local state_descr should be declared.
> Reading the man page makes me think that it certainly doesn't hurt to
> do it especially when using the ->string convention but is it in fact
> needed then to avoid any potential or concrete side-effect?
_main_complete declares it local so it mostly isn't needed.
state_descr was added much later so there were many existing functions
that didn't declare it local. Even before, we've often been lax about
declaring opt_args.
I can think of contrived cases where it would be needed. You'd need to
be using it in a state loop where _arguments/_values is also being
called as part of handling a state.
I tend to only declare it in functions that reference it.
I don't think it's really worth patching vast numbers of functions for
it but I wouldn't care either if someone wants to.
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author