zsh-users
 help / color / Atom feed
* 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, back to index

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

zsh-users

Archives are clonable: git clone --mirror http://inbox.vuxu.org/zsh-users

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.users


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git