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

Re: Removing an element from an array



On Mon, Nov 2, 2020 at 4:23 AM Peter Slížik <peter.slizik@xxxxxxxxx> wrote:
>
> By the way,  can I ask why it is necessary to re-introduce the array context by another pair of parentheses, if the expression already produces an array value?

Assignment without the parens is a scalar context; the existing type
of the variable named on the left side is not considered during
parsing, and if the variable is not "special" the type may actually be
changed from array to scalar by the assignment operation.




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