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

(a is not b) results in (a == !b) #3201

Closed
shyamdsundar opened this issue Oct 13, 2013 · 15 comments
Closed

(a is not b) results in (a == !b) #3201

shyamdsundar opened this issue Oct 13, 2013 · 15 comments

Comments

@shyamdsundar
Copy link

(a is not b) should actually be (a != b)

@epidemian
Copy link
Contributor

In CofeeScript, is is a synonym of ==, and not is a synonym of !, so the current meaning makes sense.

# These are all equivalent.
a == !b
a == not b
a is !b
a is not b

@shyamdsundar
Copy link
Author

Oh ok.

I am from python background where, "is not" means !=

Isn't the literal meaning ambiguous in the case of coffee script?

We can always have
a is (not b)

On 13 Oct 2013 14:16, "Demian Ferreiro" notifications@github.com wrote:

In CofeeScript, is is a synonym of ==, and not is a synonym of !, so the
current meaning makes sense.

These are all equivalent.a == !ba == not ba is !ba is not b


Reply to this email directly or view it on GitHubhttps://github.com//issues/3201#issuecomment-26212338
.

@thedrow
Copy link

thedrow commented Oct 13, 2013

I agree @shyamdsundar. It's confusing and misleading.

@vendethiel
Copy link
Collaborator

We have the isnt operator already.

@shyamdsundar
Copy link
Author

I assumed that is not is equivalent to != and ended up having a few bugs that were quite hard to identify and locate. I believe that there are many people like me out there :-)

@vendethiel
Copy link
Collaborator

#814 (comment), #2419 and : #1551

@rlidwka
Copy link

rlidwka commented Oct 14, 2013

is not is not the same as isnt... oops, I mean, is not isnt the same as isnt. Good luck learning english this way.

Just use != and get it over with, any kind of literate programming is a silly idea anyway. ;)

@zsitro
Copy link

zsitro commented Mar 13, 2014

isnt vs. is not is not clear haha. gave me trouble and lead to this thread.

@carlsmith
Copy link
Contributor

It makes some sense ~ comparisons are just broken in JavaScript and CoffeeScript only sugars them ~ but the inconsistency between is not and isnt is a new issue CoffeeScript introduced.

[] is not [] # false
[] isnt []   # true

Ideally, isnt would be a contraction of is not, basically an alias.

@xyrius
Copy link

xyrius commented Sep 5, 2014

Definitely a tricky one. I encountered a hard to find bug because of this.
Intuitively I also used "isnt" for "is not", they should be the same as
they mean the same in English. "not" is just bad language design for "!".

On Fri, Sep 5, 2014 at 5:07 PM, Carl Smith notifications@github.com wrote:

It makes some sense ~ comparisons are just broken in JavaScript and
CoffeeScript only sugars them ~ but the inconsistency between is not and
isnt is a new issue CoffeeScript introduced.

[] is not [] # false
[] isnt [] # true

Ideally, isnt would be a contraction of is not, basically an alias.


Reply to this email directly or view it on GitHub
#3201 (comment)
.

@adius
Copy link

adius commented Jan 12, 2015

@rlidwka Haha, great comment =D

@carlsmith
Copy link
Contributor

Maybe isnt should've been named aint.

@michaelficarra
Copy link
Collaborator

Actually, it used to be.

@lydell
Copy link
Collaborator

lydell commented Aug 15, 2015

Wow, I had no idea. That sure was some time ago.

$ git log --grep '\baint\b'
commit 985e0a080b14ea4d5a6456dbfbebe110cd3b9de0
Author: Jeremy Ashkenas <jashkenas@gmail.com>
Date:   Thu Dec 24 17:21:20 2009 -0800

    trading aint for isnt -- let's be serious

@michaelficarra
Copy link
Collaborator

Yep. Also, it's mentioned in the release notes for 0.1.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests