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

Re: Possible bug: Zsh function does not terminate when ${name:?word} fails



> This seems to be a side effect of the reserved word handling, if you do
> disable -r local
> then it behaves as expected. 

I don't think this would be a good idea. If I understand correctly, this
would make the variables global (with all consequences from a name
clash). There are other nasty consequences too.

A better workaround is IMO to separate parameter check and assignment,
for instance by

: ${foo:?hello}
local p=$foo # foo is guaranteed to have a value here

Ronald



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