From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4078 invoked by alias); 27 Jun 2015 21:51:54 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 35638 Received: (qmail 28094 invoked from network); 27 Jun 2015 21:51:52 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1435441544; bh=b54IDGr2mNi1FWaxmhKhS1gNsIagUnAv3//2mbnrWR0=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=MnrwKXzDSUReX2zv5CpJNq1Q/dOWtBuld7GsSfNxpfAd4X2rS7Kk3ol7IU4YpMlYmGtCMrLGTOhMEUEE9UdgPrcfd/RWbxFGt53Uefo6ZUhTnqPqwVysgq7aEjNHRGZUml4oZdd7VBIinMihvD8jNdGBWVPJz84oN9gahPAHuvvNqWIFfpNCNy/BJlG1HQWDpC6TAz36SevRf5Tra/kLzmeEB8CR0VwXVArysi7Oirbfb/0/Gx1HTafeV4xhYSS7GB9Wb1SElggpuee6XZyj+MeONAPZu708hIvjBFWNO63RTO9WDNdGro2Qt/76w2BXTv+WCkN0pukWBFfSFr8HBw== X-Yahoo-Newman-Id: 224976.53686.bm@smtp149.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 4bZwv0oVM1n3rYRcBXJTVtkj6Fj0_t1jluk5E03H.wLl2ls N2Z1H.1ZN.6hR7aCUWOOdSmvQhGszpuDEdnwR_1bHbNut7ub0ls52yVgOXxW NZzsbhLMgzc3DB8w7PIQWzoG4kcX7h0Djh3g95BHc4oBz63ZTzFF7Dm_RyJi n5k390logBuBRmWnSu9Uf6ElYrdAlTsI16pqAH237iBdBmENgfSu8WvpQ9mp PdXQMLXDIkhutb0QenY4MHOmMKZc6.wXRu0UJdFmGTAJ9pnnzTwMJ_Bk60_p VksorSkMrHKQOtOWzRjuvpc4O.y5KbSyS2z3HA6tBsiokOFh0L7tcBGzZ5eA UUPrNqPkHVPdup1Rlzgy0hsiwNYlq3f64bnU44kflarumzaNgGlODGQggdWM hqj7YDVQDRXuRx1vjIv7fa42ROHGu7X.5c0QPluNy66APVSJe9ccXCJXZbVb 7cI8qSphIN1kA8CDe1Hfe46VOL_.Wota3FqRY9ANnpQ_Ow1gCuZ2H70n2RS1 DCmgmvEhOfiWBi_3izAK9E9riv2t_FQ-- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- In-reply-to: <150625084618.ZM20163@torch.brasslantern.com> From: Oliver Kiddle References: <150625084618.ZM20163@torch.brasslantern.com> To: zsh-workers@zsh.org Subject: Re: Obtaining the names of all local variables MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <29779.1435441543.1@thecus.kiddle.eu> Date: Sat, 27 Jun 2015 23:45:43 +0200 Message-ID: <29780.1435441543@thecus.kiddle.eu> Bart wrote: > This got me thinking, wouldn't it be helpful if zsh/parameter had an array > $locals that holds the names of all the local parameters? Then you could > > needs_private_scope() { local -h $locals; ... } I'm not sure I understand how that would achieve a private scope. -h is only applicable to special parameters. You could do: local -h ${(k)parameters[(R)*-special]} Or you could mark every parameter local. Oliver