mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-25 17:20:25 +02:00
18571: extra note on += for associative arrays
This commit is contained in:
parent
34eed61ac8
commit
e50b688cd5
2 changed files with 14 additions and 0 deletions
|
|
@ -1,5 +1,9 @@
|
||||||
2003-07-04 Peter Stephenson <pws@csr.com>
|
2003-07-04 Peter Stephenson <pws@csr.com>
|
||||||
|
|
||||||
|
* 18571: Doc/Zsh/params.yo: Note easy way of replacing
|
||||||
|
associative array elements using +=. (Posted ages ago
|
||||||
|
and forgotten about.)
|
||||||
|
|
||||||
* 18807: baptiste daroussin <daroussi@ece.fr>:
|
* 18807: baptiste daroussin <daroussi@ece.fr>:
|
||||||
Completion/Linux/Command/.distfiles,
|
Completion/Linux/Command/.distfiles,
|
||||||
Completion/Linux/Command/_pkgtool: Completion for Slackware
|
Completion/Linux/Command/_pkgtool: Completion for Slackware
|
||||||
|
|
|
||||||
|
|
@ -257,6 +257,16 @@ patterns used for reverse subscripting (the `tt(r)', `tt(R)', `tt(i)',
|
||||||
etc. flags), but it may also affect parameter substitutions that appear
|
etc. flags), but it may also affect parameter substitutions that appear
|
||||||
as part of an arithmetic expression in an ordinary subscript.
|
as part of an arithmetic expression in an ordinary subscript.
|
||||||
|
|
||||||
|
It is possible to avoid the use of subscripts in assignments to associative
|
||||||
|
array elements by using the syntax:
|
||||||
|
|
||||||
|
example(
|
||||||
|
aa+=('key with "*strange*" characters' 'value string')
|
||||||
|
)
|
||||||
|
|
||||||
|
This adds a new key/value pair if the key is not already present, and
|
||||||
|
replaces the value for the existing key if it is.
|
||||||
|
|
||||||
The basic rule to remember when writing a subscript expression is that all
|
The basic rule to remember when writing a subscript expression is that all
|
||||||
text between the opening `tt([)' and the closing `tt(])' is interpreted
|
text between the opening `tt([)' and the closing `tt(])' is interpreted
|
||||||
em(as if) it were in double quotes (\
|
em(as if) it were in double quotes (\
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue