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 equalto #405

Merged
merged 2 commits into from
Oct 6, 2017
Merged

Add equalto #405

merged 2 commits into from
Oct 6, 2017

Conversation

ararslan
Copy link
Member

@ararslan ararslan commented Oct 5, 2017

No description provided.

@ararslan
Copy link
Member Author

ararslan commented Oct 5, 2017

Hm, 0.5 doesn't like something about the tests I copied from Base.

src/Compat.jl Outdated
immutable EqualTo{T} <: Function
x::T

EqualTo{T}(x::T) = new(x)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This defines a method for EqualTo{T} on 0.5.

# 0.7
let a = [0,1,2,3,0,1,2,3]
@test findfirst(equalto(3), [1,2,4,1,2,3,4]) == 6
@test findfirst(!equalto(1), [1,2,4,1,2,3,4]) == 2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably won't work on 0.5 either.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does--there's a Compat for it :)

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

Successfully merging this pull request may close these issues.

3 participants