zsh-workers
 help / color / mirror / code / Atom feed
From: Philippe Troin <phil@fifi.org>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh-workers@sunsite.dk
Subject: Re: Local variable declaration in loops buglet...
Date: 04 Nov 2003 22:53:38 -0800	[thread overview]
Message-ID: <877k2f8fwt.fsf@ceramic.fifi.org> (raw)
In-Reply-To: <1031105040815.ZM3307@candle.brasslantern.com>

Bart Schaefer <schaefer@brasslantern.com> writes:

> On Nov 4,  4:06pm, Philippe Troin wrote:
> }
> }   ceramic% foo() { for i in 1 2 3; do local x; x=$i;done }
> } 
> } Moving the local out of the loop fixes the echo of course... But I do
> } not think it should matter.
> 
> This is not a bug, it's documented behavior of `typeset' for which
> `local' is an alias:
> 
>     For each remaining name that refers to a parameter that is set,
>     the name and value of the parameter are printed in the form of an
>     assignment. Nothing is printed for newly-created parameters, or when
>     any attribute flags listed below are given along with the name.
> 
> In 4.1.1-dev, you can `setopt typeset_silent' to suppress this.

Oops. Did not know this behavior. Sorry for the noise.

Phil.


      reply	other threads:[~2003-11-05  6:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-05  0:06 Philippe Troin
2003-11-05  4:08 ` Bart Schaefer
2003-11-05  6:53   ` Philippe Troin [this message]

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=877k2f8fwt.fsf@ceramic.fifi.org \
    --to=phil@fifi.org \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@sunsite.dk \
    /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).