Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: wheels within wheels

On 09/29/2015 07:55 PM, Kurtis Rader wrote:
Never heard of it. But thanks for the link. I forget that shells aren't 'real' languages. Nuts, I'm even getting used to not declaring variables. As Bart once said, shells are
a glue for various command line operations.

In short: don't do it.

I wouldn't, unless there was some sort of wonderful reason to, which is what I'm asking.

You can see for yourself that nested, named,
function definitions are in fact globally visible (as opposed to visible
only to the function in which they're defined) by executing the following
script. Anonymous functions defined within another function are a different
matter but outside the scope of this question.

Yeah, I ran my own tests and it seems so. One might think that this would be some sort of localization mechanism, but it seems not to be the case. Ok, thanks Kurtis, I'll not
try any such thing.  It seems very strange that it's even legal.

Messages sorted by: Reverse Date, Date, Thread, Author