Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: Explain array append a bit better
- X-seq: zsh-workers 33855
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: zsh workers <zsh-workers@xxxxxxx>
- Subject: Re: PATCH: Explain array append a bit better
- Date: Fri, 05 Dec 2014 13:25:52 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1417782354; bh=7wqEnA7MDJoMM1kUhE2EJfhypv7SeMP6p0wcwQr5ybg=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=PLcXN2/0/e9dDUJifsqhSgjSXen1PjAMY2crG+4l2ppNpYpND27X4LeSimB5RqBv5dwUs6UN/GAuqiYOq4yZ+ORHQsuI8/YI4NausbtdiX8ogSUesSLRImwQtH94r8E126vDUHMiD41Q4kVriqIjhxBTrR9HpB6bMcQMNunzXI2IGqZ2p8vL2J7NDiT9mtrbX9jsyBQ/EYmyi0ukkPulfkkcrgefVL7d0CA83FaYnTUSmEVF1FSx6NIn0nDVQ/gk8K2bwsdPzFOjUAXXTY4+kjVkNcQhT/ESuAgnxNc5sPvKxv4Q2lPtdf3ZOTJwG86EJzfChCX7jyqttAI+LsoBuA==
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.co.uk; b=udjid4/6+PRRVVOvWclLM7sHRFvkYjvAvxDSY1FaZ1l3LApZGA924ntCg/hGQ5OlrmJGn1fmgm9yMNnpcYzo70beJo/Z1pKKpl0ynzaBUNCZBJm2LY3YNoHQgdVvyRjudg6iw7KE8yIey9P1psJwaHh0a2qvFQM/UVgfXLeKcPqrnG3+kz38s52oi1GIJGkbCkouyfN003ft+Rp6cX6BBcUpttJljdgZnqolvKbKWduFWGeUz+ToF3R+ZdxmH7FgwbkqOsDyvtoerztZyTp3qP8VpYEP1Hi0+6fQ71TdEIRcA+M1ITqNB1owbcgur5P9lMD5yOWRvGCejuYLe9H18A==;
- In-reply-to: <CAHYJk3R49_MSWWQQ_HTb-iFWnZQ_99LUeLKrVbC8WA=a8AeLgg@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>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <141203205120.ZM7564@torch.brasslantern.com> <CAHYJk3R49_MSWWQQ_HTb-iFWnZQ_99LUeLKrVbC8WA=a8AeLgg@mail.gmail.com>
Mikael Magnusson wrote:
> Should we perhaps mention array prepending somewhere too? I read the
> sections "Array Subscripts" and "Array Element Assignment", and
> searched for the string 1,0 and came up with nothing.
I think that was left undocumented intentionally in the first place. I
could be wrong but, in the code, it looks like behaviour that fell out
of the implementation rather than something that was designed in. It
isn't exactly nice and I wouldn't ever use it in scripts. Interactively,
I have an abbreviation for it that I rarely use but also have aliases
like: alias -- +fpath='fpath=( ~+ $fpath)'
I don't really have an opinion either way on whether we should document
it now. I'd prefer to see some other syntax introduced. When we last
discussed prepending (30962), []= was the best suggestion we had
but needs to touch the current subscript code so is trickier to to
implement. -= ^= and /= were rejected before.
Another option that occurs to me now is
+var=( ... )
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author