Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Obtaining the names of all local variables
- X-seq: zsh-workers 35638
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Obtaining the names of all local variables
- Date: Sat, 27 Jun 2015 23:45:43 +0200
- 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==
- In-reply-to: <150625084618.ZM20163@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <150625084618.ZM20163@torch.brasslantern.com>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author