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 melb.werple.net.au (8.7.5/8.7.3/2) with ESMTP id IAA13439 for ; Wed, 3 Jul 1996 08:35:13 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id SAA04647; Tue, 2 Jul 1996 18:30:17 -0400 (EDT) Resent-Date: Tue, 2 Jul 1996 18:30:17 -0400 (EDT) From: Anthony Heading Message-Id: <199607022227.XAA25585@gmp-etpres1.uk.jpmorgan.com> Subject: Re: Tag functions with shell options? To: schaefer@nbn.com Date: Tue, 2 Jul 1996 23:27:35 +0100 (BST) Cc: aheading@jpmorgan.com, zsh-workers@math.gatech.edu In-Reply-To: <960702143114.ZM5210@candle.brasslantern.com> from "Bart Schaefer" at Jul 2, 96 02:31:10 pm MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"X9xOu.0.X81.vBQsn"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1516 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Bart wrote: > > } The lack of context was sort-of deliberate, since I > } suspected any interest would be in the wider picture, rather than my > } particular petty problems. It seemed simply an example of something > } it would be nice to support elegantly. > > This introduces a whole class of problems, which is most obvious in the > case when you *do not* know the names of the functions that should have > their local options (or whatever) changed. In that case you almost end > up needing something like Perl's "package". Right. I guess this is like what I would have thought of doing as a sort of closure. So a function, when defined, would snapshot its option-environment. function setup() { setopt local_options closure_options sh_word_split . /someone/elses/setup/file.sh } > Because the alias for yfn was introduced *after* xfn1 was defined, xfn1 > still references the "real" yfn, rather than the alias. The presumption > is that if you're going to use OK. As if aliases are resolved at parse-time. Or something. Perhaps they are. I should RTFS. But I understand now. Thank-you all. A