zsh-users
 help / color / mirror / code / Atom feed
From: nix@myproxylists.com
To: "\"René 'Necoro' Neumann\"" <lists@necoro.eu>
Cc: zsh-users@zsh.org
Subject: Re: Local inner functions
Date: Thu, 24 Mar 2011 03:16:07 +0200	[thread overview]
Message-ID: <c5d4f6a1f045fbb991229a7d8601e17e.squirrel@gameframe.net> (raw)
In-Reply-To: <4D8A810A.3050300@necoro.eu>

> 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'?




  reply	other threads:[~2011-03-24  1:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-23 23:23 René 'Necoro' Neumann
2011-03-24  1:16 ` nix [this message]
2011-03-24  8:50   ` René 'Necoro' Neumann
2011-03-24  1:41 ` Bart Schaefer
2011-03-24  9:38   ` René 'Necoro' Neumann
2011-03-24 11:51     ` Mikael Magnusson

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=c5d4f6a1f045fbb991229a7d8601e17e.squirrel@gameframe.net \
    --to=nix@myproxylists.com \
    --cc=lists@necoro.eu \
    --cc=zsh-users@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).