From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: zsh workers <zsh-workers@zsh.org>
Subject: Re: When local state_descr is needed?
Date: Thu, 09 Jun 2016 16:43:44 +0200 [thread overview]
Message-ID: <2042.1465483424@thecus.kiddle.eu> (raw)
In-Reply-To: <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
next prev parent reply other threads:[~2016-06-09 14:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-09 9:57 Marko Myllynen
2016-06-09 14:43 ` Oliver Kiddle [this message]
2016-06-09 18:10 ` Marko Myllynen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2042.1465483424@thecus.kiddle.eu \
--to=okiddle@yahoo.co.uk \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).