On 12/16/14, 2:53 AM, Dan Douglas wrote: > On Sunday, December 14, 2014 02:39:29 PM Chet Ramey wrote: >> And we get to the fundamental issue. Is it appropriate to require >> arguments to declaration commands to be valid assignment statements when >> the parser sees them, instead of when the builtin sees them, at least >> when using the compound assignment syntax. >> >> I'm ok with tightening the rules and saying that it is, but it's not >> backwards compatible and changes the behavior of things like >> >> declare -a foo='(1 2 3)' >> >> which I imagine plenty of people have used and has been a supported way >> to do compound assignment for many years. > > That would be one way but I think this can be solved without going quite > so far. How do you feel about these rules?
For context, these are the current semantics that bash attempts to implement. This change is slated for the next release of the standard (issue 8). http://austingroupbugs.net/view.php?id=351 This introduces the concept of a `declaration utility' and specifies their behavior with respect to assignment statements as arguments. In bash, declare, typeset, local, export, and readonly are all declaration commands. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/