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

Re: PATCH: pws-19: minor syntactic innovation



On May 23,  5:15pm, Peter Stephenson wrote:
} Subject: PATCH: pws-19: minor syntactic innovation
}
} Just thought of a trivial way to take a lot of grief out of parameter
} substitution.  This patch makes the following valid:
} 
}   ${${${${(f)"$(typeset)"}:#*local *\=*}%%\=*}##* }

OK, the patch is straightforward to adapt and the results seem to be the
same in 3.0.6-pre-3 and 3.1.5-pws-20.

A few questions come up, however:

What's the parse of something like ${(f)"${"$(typeset)"}"} ?  It doesn't
seem to be the `obvious' one -- it appears that the quoted strings are
actually nesting, because of the enclosing braces, which is something
pretty radically new.  (I may be wrong.)  Is this a good thing?

What's the right way to document this change, including odd stuff like
the above?

Should the FAQ recommend using this form in some circumstances because
of the (@) change in 3.1.5?

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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