about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2008-03-23 05:13:57 +0000
committerBart Schaefer <barts@users.sourceforge.net>2008-03-23 05:13:57 +0000
commit7ffc16e946c76a0d4eb6b3df63e3342cba672734 (patch)
tree6515b3834c5ee152b470347ad3c09dbb186f6045
parent337cc1288797a1435e6fbbf0945a7cdb94d152b1 (diff)
downloadzsh-7ffc16e946c76a0d4eb6b3df63e3342cba672734.tar.gz
zsh-7ffc16e946c76a0d4eb6b3df63e3342cba672734.tar.xz
zsh-7ffc16e946c76a0d4eb6b3df63e3342cba672734.zip
unposted: further documentation tweak for the (R) and (I) subscript flags.
-rw-r--r--ChangeLog7
-rw-r--r--Doc/Zsh/params.yo21
2 files changed, 18 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index a84c90582..e3c344d94 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,11 @@
+2008-03-22  Barton E. Schaefer  <schaefer@zsh.org>
+
+	* unposted: Doc/Zsh/params.yo: further documentation tweak for the
+	(R) and	(I) subscript flags.
+
 2008-03-18  Barton E. Schaefer  <schaefer@zsh.org>
 
-	* unposted: Doc/Zsh/params.yo: Tweak documentation for the (i) and
+	* unposted: Doc/Zsh/params.yo: tweak documentation for the (i) and
 	(I) subscript flags.
 
 	* 24717, 24718, 24719: Completion/compinstall, Src/params.c,
diff --git a/Doc/Zsh/params.yo b/Doc/Zsh/params.yo
index 94a2d9ea5..797fc3e0e 100644
--- a/Doc/Zsh/params.yo
+++ b/Doc/Zsh/params.yo
@@ -225,6 +225,13 @@ example (assuming the option tt(KSH_ARRAYS) is not in effect):
 example([[ ${array[(i)pattern]} -le ${#array} ]])
 
 If tt(KSH_ARRAYS) is in effect, the tt(-le) should be replaced by tt(-lt).
+item(tt(R))(
+Like `tt(r)', but gives the last match.  For associative arrays, gives
+all possible matches. May be used for assigning to ordinary array
+elements, but not for assigning to associative arrays.  On failure, for
+normal arrays this has the effect of returning the element corresponding to
+subscript 0; this is empty unless one of the options tt(KSH_ARRAYS) or
+tt(KSH_ZERO_SUBSCRIPT) is in effect.
 
 Note that in subscripts with both `tt(r)' and `tt(R)' pattern characters
 are active even if they were substituted for a parameter (regardless
@@ -238,13 +245,6 @@ tt($key):
 example(key2=${key//(#m)[\][+LPAR()+RPAR()\\*?#<>~^]/\\$MATCH}
 print ${array[(R)$key2]})
 )
-item(tt(R))(
-Like `tt(r)', but gives the last match.  For associative arrays, gives
-all possible matches. May be used for assigning to ordinary array
-elements, but not for assigning to associative arrays.  On failure, for
-normal arrays this has the effect of returning the element corresponding to
-subscript 0; this is empty unless one of the options tt(KSH_ARRAYS) or
-tt(KSH_ZERO_SUBSCRIPT) is in effect.
 )
 item(tt(i))(
 Like `tt(r)', but gives the index of the match instead; this may not be
@@ -252,11 +252,14 @@ combined with a second argument.  On the left side of an assignment,
 behaves like `tt(r)'.  For associative arrays, the key part of each pair
 is compared to the pattern, and the first matching key found is the
 result.  On failure substitutes the length of the array plus one, as
-discussed under the description of `tt(r)'.
+discussed under the description of `tt(r)', or the empty string for an
+associative array.
 )
 item(tt(I))(
 Like `tt(i)', but gives the index of the last match, or all possible
-matching keys in an associative array.  On failure substitutes 0.
+matching keys in an associative array.  On failure substitutes 0, or
+the empty string for an associative array.  This flag is best when
+testing for values or keys that do not exist.
 )
 item(tt(k))(
 If used in a subscript on an associative array, this flag causes the keys