-
Notifications
You must be signed in to change notification settings - Fork 64
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
Is Not Nothig, should be something! #581
Comments
I can also debate that |
SQL allows this: Column Is Not Null
Not Column Is Null It's kind of a pity that: If Obj Is Something Then would be a breaking change. |
Not necessarily. VB introduced the concept of a smart non breaking keywords with IinQ and Iterator, and Async. This is a valid syntax: LinQ Keywords are bound only to their context. So, It is possible to have the new Something keyword, that is treated as a keyword only after the Is keyword, otherwise it is a normal token. The precedence will be for var names and member names, so, no old code will break. |
Besides, we don't need the |
Consistency is important, though. Today, For a brand new language, where consistency doesn't have to fight with compatibility, I wouldn't mind it. My hobby BASIC compiler actually parses |
Sure it is consistent. |
Actually, thanks to late-bound and boxing, you can write this: Dim x As Object = True
Dim y As Object = False
Console.WriteLine(x Is Not y) (Perhaps strangely, the result is Also, you can overload the Again, not saying I dislike the syntax, but backward compatibility with scenarios like these probably makes it impossible for VB. |
In fact you just reported a bug that needs a fix. This is insane behaviour of VB and no one would ever write code with this nonsense. If |
See.issue.no 546.of August 3. I tend.to.agree.that 'Something' is shorthand.for 'Is.Not Nothing' |
@salelele
|
What and I missing "IsNot Nothing" works as expected? What does adding a space do?
|
Closing this out as this is already legal and has sane semantics for vb. We're definitely not going to take a breaking change here that could impact real programs that have already shipped. |
What is wrong with:
If Obj Is Not Nothing Then
?I think
IsNot
was a bad decision to make in the first place.Is Not Nothing
doesn't compile now, so, it is possible to allow it and convert it under the hood toIsNot Nothing
. The first is the natural readable syntax, and there is nothing confusing about it, both for human and compiler. I am aware that some will argue that 'Not Nothingis not a Boolean expression, but it is a normal English expression, that VB tries to be as close as possible to it. And as long there is no other possible meaning to
Is Not Nothing`, so, there is no need at all to forbid it. Again: This is VB not C#, where the compiler should out smart us!The text was updated successfully, but these errors were encountered: