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

Add !=(2) to parallel ==(2) #29886

Closed
cstjean opened this issue Nov 1, 2018 · 4 comments
Closed

Add !=(2) to parallel ==(2) #29886

cstjean opened this issue Nov 1, 2018 · 4 comments

Comments

@cstjean
Copy link
Contributor

cstjean commented Nov 1, 2018

The ==(2) method is a convenient replacement of x->x==2. Could we also have !=(2)?

EDIT: isa(Vector) and ===(2) would be nice, too.

@ronisbr
Copy link
Member

ronisbr commented Nov 1, 2018

I suppose that we cannot define this for the other types of comparisons like >= or <= right?

@JeffBezanson
Copy link
Member

Sure we can. It just gets a bit confusing, since in <(2) it might not be clear whether the 2 is the left or right argument.

@StefanKarpinski
Copy link
Member

StefanKarpinski commented Nov 1, 2018

The convention we decided on is that we do this kind of "auto-currying" for

predicate(subject, object)

functions taking two arguments and the curried form is

subject -> predicate(subject, object)

So in(collection) means

item -> item in collection

By that rule <(b) means a -> a < b which makes sense since you read it as "less than b".

@cstjean
Copy link
Contributor Author

cstjean commented Feb 25, 2019

Fixed by #30915

@cstjean cstjean closed this as completed Feb 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants