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

Re: PATCH: += parameter assignments



Borsenkow Andrej wrote:
> 
> > One possible extension beyond what ksh does would be to also add a -=
> > assignment. It could be made to prepend to string and array values

> I would prefer += and =+ but that probably breaks ksh93 compatibility.

This issue wouldn't be ksh93 compatibility so much as backward
compatibility with old zsh scripts or any other scripts.

% a-=val
zsh: command not found: a-=val
% a=+val
% echo %a
+val

With `-' (or `+') not being legal inside identifiers -= only affects
anyone who happens to have a command with `-=' in its name - that should
be fairly rare. Affecting any script that assigns a variable with `+' as
the first character is much more likely to matter (a quick grep shows
two cases in the completion functions).

Do any other languages use `=+' as an operator. Anyone else have any
views on it?

Oliver

_____________________________________________________________________
This message has been checked for all known viruses by the 
MessageLabs Virus Scanning Service. For further information visit
http://www.messagelabs.com/stats.asp



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