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

Re: Possibly excessive WARN_CREATE_GLOBAL



Bart Schaefer wrote:
> No time to fix it now, but declaring something "private" suppresses the
> warncreateglobal warning without allowing the variable to become set in
> the inner scope.  (What SHOULD happen here?  An error?)

Do you mean, it gets created in the inner scope as if it were global but
gets wiped out in the higher scope?  That would be functionally OK in
the particular case but dodgy as far as the definition of the inner
function is concerned.  It might be more weight for an extended warning
"created without localisation in some inner scope even though it doesn't
actually propagate back to the top level", except shorter.

Or do you mean it doesn't actually get set *at all*?  That should surely
trigger an error immediately in the inner scope, shouldn't it?

pws



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