From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3670 invoked by alias); 31 Dec 2012 23:30:36 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17516 Received: (qmail 8113 invoked from network); 31 Dec 2012 23:30:34 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at linux.vnet.ibm.com does not designate permitted sender hosts) Date: Tue, 1 Jan 2013 07:30:02 +0800 From: Han Pingtian To: zsh-users@zsh.org Subject: Re: Creating A Clean Environment For Autoloaded Functions Message-ID: <20121231233002.GC2054@localhost.localdomain> References: <121230112044.ZM879@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <121230112044.ZM879@torch.brasslantern.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12123123-9360-0000-0000-00000E99724B On Sun, Dec 30, 2012 at 11:20:44AM -0800, Bart Schaefer wrote: > { > zmodload zsh/parameter > local -a existing_modules > existing_modules=( ${(k)modules[(R)loaded]} ) > > : do whatever zmodloads you want ... > > } always { > # Requires zsh 5.0, otherwise you need a loop > zmodload -u ${(k)modules[(R)loaded]:|existing_modules} How could we know that, the "(k)" will be run before ":|" here, please? Because "k" will be applied with the subscripting, so it will be before the ":|" ? Thanks. > }