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

Re: local after setopt allexport?

On Wed  7 Aug 1996 09:29:22 +0200,
   Peter Stephenson <pws@xxxxxx> wrote:
> faith@xxxxxxxxxx wrote:
> > Is there a way to keep variables from being exported after setopt
> > allexport?
> Variables are only exported when set, so you can temporarily unset the
> option and set the variable in a shell function to get this effect.
> You might need to make `noexport' more sophisticated.

Thanks for the work-around.

If this is not a compatibility or historical practice issue, I'd like to
suggest that the commands "local", "typeset", etc. all look like they are
used to declare the "type" of a variable.  As such, it seems that
"exportable" is a type attribute and that this attribute should be
associated with a variable for the remainder of its lifetime (or until
another typeset).  This could be implemented internally in zsh with a
tri-state flag: +x for exportable, -x for local, and ?x for "use the
current state of the allexport option".  If the export semantics in zsh can
be changed (and the maintainers are willing), I'll try to submit patches.
(But I don't want to do this if the current semantics are required by, for
example, ksh.)

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