zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: LOCAL_VARS option ?
Date: Sun, 22 Jan 2017 19:00:52 +0000	[thread overview]
Message-ID: <20170122190052.327898df@ntlworld.com> (raw)
In-Reply-To: <alpine.LRH.2.00.1701221030270.4560@toltec.zanshin.com>

On Sun, 22 Jan 2017 10:45:21 -0800 (PST)
Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Fri, 20 Jan 2017, Peter Stephenson wrote:
> 
> > Here's a first go at the warning option, with "functions -W" to turn it on
> > in the same fashion as "functions -T".  The option is called
> > WARN_NESTED_VAR for now.
> 
> This is almost exactly what I was thinking ... except I wasn't thinking
> of it having a name that could be accessed with setopt.  I was thinking
> more of something that could ONLY be activated by "functions -W".

I did think about this.  The other way just gives a hidden variable
which is still there but you can't access, so the shell sort of had the
capability to apply this to a whole hierarchy of functions at once but
you couldn't actually use it.  That didn't seem particularly useful.

> Possible logical extensions would be to warn only if the variable is
> truly in global scope, or to warn only if the variable is NOT in global
> scope (i.e., is local to some caller's scope).  If -W were implemented
> in some other way than as a setopt, it could accept arguments (along
> the lines of gcc -W...) to indicate different kinds of warnings.

I'm not sure I'd want it to be complicated enough not to be at least
encodable as an option, though as it's for debugging I suppose it's not
that big a deal.

We've got a byte's worth of data with options we could use more
expressively anyway.  I think we've vaguely discussed this before.

pws


  reply	other threads:[~2017-01-22 19:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170119070023epcas3p17d787fb31e7c04d5bcf2231020769b5f@epcas3p1.samsung.com>
2017-01-19  6:54 ` Daniel Shahaf
2017-01-19  9:43   ` Jens Elkner
2017-01-19  9:45   ` Peter Stephenson
2017-01-19 15:47   ` Bart Schaefer
2017-01-19 16:08     ` Peter Stephenson
2017-01-20  5:01       ` Bart Schaefer
2017-01-20 17:19         ` Peter Stephenson
2017-01-22 18:45           ` Bart Schaefer
2017-01-22 19:00             ` Peter Stephenson [this message]
2017-01-23 10:09               ` Peter Stephenson
2017-01-23 11:20                 ` Daniel Shahaf
2017-01-23 11:37                   ` Peter Stephenson
2017-01-25  5:50                   ` Daniel Shahaf
2017-01-25  9:24                     ` Peter Stephenson
2017-01-25 19:32                       ` Daniel Shahaf
2017-01-25 21:50                         ` Bart Schaefer
2017-01-29 21:21                           ` Daniel Shahaf
2017-01-26 19:43                       ` Peter Stephenson
2017-01-26 20:04                         ` Peter Stephenson

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=20170122190052.327898df@ntlworld.com \
    --to=p.w.stephenson@ntlworld.com \
    --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).