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

Re: Typeset with array



On Fri, 26 Jun 2015 21:14:04 +0200
Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote:
> Sounds fair enough, however, in the case of something like:
>   % typeset -i i=(2+3)*4
>   zsh: no matches found: *4
> it isn't exactly staring you in the face.

Yes, it's being parsed as "i=(2+3)" followed by "*4", just as

i=(2+3)*4

would always have been parsed.

That's always been a bad thing to do, though.  Unquoted parentheses and
* will always lead you astray.  You'd have got away before with
NO_NOMATCH, but relying on that isn't great practice, to say the least.

I could make array asignments without a following space an error,
probably, but as you noted that's breaking cases that used to work, and
I don't like to do it only after typeset.

pws



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