Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: A tip: a technique to limit the # of global variables
- X-seq: zsh-workers 44816
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- Subject: Re: A tip: a technique to limit the # of global variables
- Date: Fri, 11 Oct 2019 10:26:59 +0200
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RjpTO8pnq0tXIoxYOrwlB50l6vcQt+b6j1B2j0YWn/0=; b=Dx5H7G13WgvqDRz2iN/pKGKXQPVnWUuB34No4IZmuKqsl/7yQmP6qyoaywleTCnCtn qmeT+doc72iiyv5JWtenCOILBB8smt2NyH47a6sB5a3SRALLg3xhFRErv5OJxP1jGrEw xmWSdjFGJXHwk2YRIUml9UhuqDaRikUw6SBb1+GzW0wqX3IEoENOTWPwQI45xaOO1i7P bbXc0JnX2i8JLWcyJSWoKUcW/Uq7oKBRB5pCTMCmIcFBXFQTOQJUdUrXo/zGf8iKcsRM Lhq8zWlTGhLDjRAzsPMc4TI1P36WVofBJlVeiSkaPE0tMdtXtOKLCISVDiNGjBCHRJNX bRHQ==
- In-reply-to: <CAKc7PVDfuyP0Q8AOazMDtRetg6ZWDGqFhu1KT3927a-Ze4RFxQ@mail.gmail.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>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVDfuyP0Q8AOazMDtRetg6ZWDGqFhu1KT3927a-Ze4RFxQ@mail.gmail.com>
On Fri, Oct 11, 2019 at 10:21 AM Sebastian Gniazdowski
<sgniazdowski@xxxxxxxxx> wrote:
>
> Hello,
> when writing a plugin one often needs to keep a state during the Zsh
> session. To do this it is natural to use global parameters. However,
> when the number of the parameters grows one might want to limit it.
What are the advantages of having fewer global parameters? Why is it
better to have this:
typeset -gA PLGMAP=(foo 42 bar hello)
Than this:
typeset -gi PLGMAP_foo=42
typeset -g PLGMAP_bar=hello
Roman.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author