Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

`not` as prefix operator causes problems #9574

Closed
krux02 opened this issue Oct 30, 2018 · 1 comment

Comments

Projects
None yet
3 participants
@krux02
Copy link
Contributor

commented Oct 30, 2018

Even though not looks much like a function call, it is a symbol, and that causes confusion.

Example

proc isFalse(a: int): bool = false

assert not isFalse(3) # parsed as infix not with ``assert`` as argument
assert not(isFalse(3)) #  ^^ same

Additional Information

this is the original issue: #8300

@krux02 krux02 added the Parser label Oct 30, 2018

@krux02 krux02 changed the title not as prefix operator causes problems `not` as prefix operator causes problems Oct 30, 2018

@Araq Araq added the Easy label Oct 30, 2018

@timotheecour

This comment has been minimized.

Copy link
Contributor

commented Oct 30, 2018

from #8300 (comment) by @Araq

Well we can decide that not is special and always only an unary operator. That would fix it and no code out there uses an overloaded binary not operator anywhere, I guess.

nc-x added a commit to nc-x/Nim that referenced this issue Oct 31, 2018

nc-x added a commit to nc-x/Nim that referenced this issue Oct 31, 2018

@Araq Araq closed this in 8a357c2 Nov 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.