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

Re: [PATCH] typeset reply array



On May 18,  5:33am, Clint Adams wrote:
}
} I think that some of these will break things.

(Stylistically, "local" or "declare" should probably be used instead of
"typeset" when the intent is to make local parameters.)

The right thing to do (if there is a right thing) is use "typeset -g ..."
to explicitly create them as globals where appropriate.  This suppresses
the warning without changing the behavior.

On the other hand I think zsh could make reply/REPLY into particular
exceptions to the warning.  Although they're not "special parameters"
in the true sense, it's also the case that they're never (or always,
depending on your point of view) intended to be local to the scope
where they're assigned.  It's not safe to use them for anything but
their reserved purpose because they'll get cleared in the internals
if any operation that may employ them is called.

-- 



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