From: Sebastian Gniazdowski <psprint3@fastmail.com>
To: zsh-workers@zsh.org
Subject: Append to array via (P) flag
Date: Sat, 18 Mar 2017 08:13:11 -0700 [thread overview]
Message-ID: <1489849991.578651.915517240.3CDC6181@webmail.messagingengine.com> (raw)
Hello,
I've written simple text editor in ZUI and the supported number of lines
is 1000. With 5.3.1-dev-0 it is 6000, but the code needs special
construct. Problem is in API function that does:
__output=( "${(P@)__var_name}" "New data" )
: ${(PA)__var_name::=${__output[@]}}
There is no append-syntax recognized by (P), so no easy way to trigger
optimizations. Maybe this can be added? Parameter like __var_name could
be set to:
- reply[]
- reply[-]
- reply[,]
So doing e.g. reply[,]=( "New data" ) would work like reply+=( "New
data" )
Maybe it's best to discover something really special so there is no
impression that shell syntax changes. Or opposite, use e.g. comma,
because it is already used inside [].
--
Sebastian Gniazdowski
psprint3@fastmail.com
next reply other threads:[~2017-03-18 15:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-18 15:13 Sebastian Gniazdowski [this message]
2017-03-18 17:07 ` Bart Schaefer
2017-03-18 17:32 ` Sebastian Gniazdowski
2017-03-18 21:50 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1489849991.578651.915517240.3CDC6181@webmail.messagingengine.com \
--to=psprint3@fastmail.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).