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

Re: ${(P)${foo}} (Re: Associative array ordering)



I wrote:

> Bart Schaefer wrote:
> 
> > Let's go this way:  Implement ${(P)foo}, the same as ${(P)${foo}} where
> > the inner ${...} has no flags or modifiers, and leave ${!foo} undefined
> > until we do real namerefs (if we ever do).
> 
> Yep.

I forgot to append the patch for the docs, sorry.

Bye
 Sven

--- od/Zsh/expn.yo	Wed Feb  3 08:46:59 1999
+++ Doc/Zsh/expn.yo	Wed Feb  3 11:06:10 1999
@@ -525,13 +525,13 @@
 nested but too deep recursion may have unpredictable effects.
 )
 item(tt(P))(
-If used with a parameter name, this flag has no effect. But if it is
-used with a tt(${)...tt(}) type parameter expression or a
-tt($LPAR())...tt(RPAR()) type command substitution in place of
-the parameter name this flag makes the result of the expansion be
-taken as a parameter name which is then used. E.g. if you have
-`tt(foo=bar)' and `tt(bar=baz)', the string `tt(${(P)${foo}})' will be 
-expanded to `tt(baz)'.
+This makes the value of the parameter var(name) be taken as a
+parameter name on which to work. If it is used with a tt(${)...tt(})
+type parameter expression or a tt($LPAR())...tt(RPAR()) type command
+substitution in place of the parameter name this flag makes the result
+of the expansion be taken as a parameter name which is then
+used. E.g. if you have `tt(foo=bar)' and `tt(bar=baz)', the strings
+`tt(${(P)foo}' and `tt(${(P)${foo}})' will be expanded to `tt(baz)'.
 )
 item(tt(o))(
 Sort the resulting words in ascending order.

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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