Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Append to array via (P) flag



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@xxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author