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 SAA02026 for ; Mon, 12 Aug 1996 18:19:26 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id EAA02980; Mon, 12 Aug 1996 04:04:32 -0400 (EDT) Resent-Date: Mon, 12 Aug 1996 04:04:32 -0400 (EDT) Message-Id: <199608120803.KAA29459@hydra.ifh.de> To: zsh-workers@math.gatech.edu (Zsh hackers list) Subject: Re: local after setopt allexport? In-reply-to: "schaefer@candle.brasslantern.com"'s message of "Fri, 09 Aug 1996 09:42:24 MET." <960809094225.ZM23675@candle.brasslantern.com> Date: Mon, 12 Aug 1996 10:03:11 +0200 From: Peter Stephenson Resent-Message-ID: <"SM8jR1.0.Vk.GMk3o"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1947 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu schaefer@candle.brasslantern.com wrote: > Great Manitoba! Finally something that makes sense! That would > explain why "typeset" acts like "local" when used inside a function: > because it *always* acts like "local". That's mostly true of zsh too, with the exception that anything exported becomes global, otherwise it was impossible to export anything from a function. Actually, the only difference there is that in zsh you can't have `local -x', which you can in ksh; typeset -x in both exports the variable globally. In this case local and typeset behave differently in ksh. > What does ksh do with > > FOO=bar > export FOO > typeset FOO=foo > > ?? Does that make FOO local? If called in a function it creates a new copy of FOO with the value foo, leaving the exported value as bar. Otherwise, it changes the exported value. None of this particularly increases my enthusiasm for either local variable mechanism. -- Peter Stephenson Tel: +49 33762 77366 WWW: http://www.ifh.de/~pws/ Fax: +49 33762 77330 Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen DESY-IfH, 15735 Zeuthen, Germany.