From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by coral.primenet.com.au (8.7.5/8.7.3) with ESMTP id OAA05267 for ; Fri, 9 Aug 1996 14:15:56 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id AAA22350; Fri, 9 Aug 1996 00:12:22 -0400 (EDT) Resent-Date: Fri, 9 Aug 1996 00:05:36 -0400 (EDT) Date: Thu, 8 Aug 1996 22:50:52 -0400 Message-Id: <199608090250.WAA00413@winter.cs.unc.edu> From: Rik Faith To: Peter Stephenson Cc: Rik Faith , zsh-users@math.gatech.edu Subject: Re: local after setopt allexport? In-Reply-To: [Peter Stephenson ] Wed 7 Aug 1996 09:29:22 +0200 References: <199608061938.PAA07278@proteus.cs.unc.edu> <199608070729.JAA29678@hydra.ifh.de> X-Mailer: VM 5.72 (beta); Emacs 19.27.1; Linux 2.0.11 (winter) X-Url: http://www.cs.unc.edu/~faith/ X-Pgp-Key: 45A0CE31; 69 24 9D D4 4B FA 9C 45 66 09 49 79 DA E9 FA D6 Resent-Message-ID: <"QKoAo2.0.AS5.Gah2o"@euclid> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/349 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Wed 7 Aug 1996 09:29:22 +0200, Peter Stephenson wrote: > faith@cs.unc.edu 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.)