From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1449 invoked by alias); 24 Mar 2011 01:16:21 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 15884 Received: (qmail 22778 invoked from network); 24 Mar 2011 01:16:10 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at myproxylists.com designates 217.119.39.74 as permitted sender) X-Originating-IP: 127.0.0.1 Message-ID: In-Reply-To: <4D8A810A.3050300@necoro.eu> References: <4D8A810A.3050300@necoro.eu> Date: Thu, 24 Mar 2011 03:16:07 +0200 Subject: Re: Local inner functions From: nix@myproxylists.com To: =?iso-8859-1?Q?=22Ren=C3=A9_'Necoro'_Neumann=22?= Cc: zsh-users@zsh.org User-Agent: SquirrelMail/1.4.20 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal > Hi all, > > I often use the construct of defining a function inside another > function. Now I discovered, that these pour into the environment, i.e. > if I have > > foo () > { > bar () { } > } > > and I execute "foo", "bar" is now visible in my environment. > > Is there some way of making 'bar' to be local to 'foo'? Using the > 'local' keyword does not work :). > > I know, that in principle it is possible to explicitly 'unfunction' > functions, but this is not a usable way sometimes. > > Thanks for your help, > René > > I think localing is possibly only to variables as you know. What you're trying to achieve by localing 'bar' inside 'foo'?