* Why such math-expression error?
@ 2020-07-06 6:56 Sebastian Gniazdowski
2020-07-06 11:19 ` Sebastian Gniazdowski
0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Gniazdowski @ 2020-07-06 6:56 UTC (permalink / raw)
To: Zsh Users
[-- Attachment #1: Type: text/plain, Size: 562 bytes --]
Hi
I've got in a script a code:
(( ${+ice[make]} )) && ...
It causes the following error:
∞zinit-make-hook:9: bad math expression: operand expected at end of string
When I do local -A ice, the error disappears. Printing ${(t)ice} shows
empty string, and unset ice doesn't help.
Why such error? In interactive shell, I can $+ basically any expression I
want in an $((, specifically (( ${+unset_var[string]} )) works fine.
--
Sebastian Gniazdowski
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zinit
Blog: http://zdharma.org
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Why such math-expression error?
2020-07-06 6:56 Why such math-expression error? Sebastian Gniazdowski
@ 2020-07-06 11:19 ` Sebastian Gniazdowski
2020-07-06 23:48 ` Daniel Shahaf
0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Gniazdowski @ 2020-07-06 11:19 UTC (permalink / raw)
To: Zsh Users
[-- Attachment #1: Type: text/plain, Size: 115 bytes --]
Ah, I've had a `make' variable and it was dereferenced in the math context
of the undefined array's subscript…
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Why such math-expression error?
2020-07-06 11:19 ` Sebastian Gniazdowski
@ 2020-07-06 23:48 ` Daniel Shahaf
0 siblings, 0 replies; 3+ messages in thread
From: Daniel Shahaf @ 2020-07-06 23:48 UTC (permalink / raw)
To: Sebastian Gniazdowski; +Cc: Zsh Users
Sebastian Gniazdowski wrote on Mon, 06 Jul 2020 13:19 +0200:
> Ah, I've had a `make' variable and it was dereferenced in the math context
> of the undefined array's subscript…
Thanks for following up.
In the future, please send a minimal reproduction recipe with each bug report.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-07-06 23:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-06 6:56 Why such math-expression error? Sebastian Gniazdowski
2020-07-06 11:19 ` Sebastian Gniazdowski
2020-07-06 23:48 ` Daniel Shahaf
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).