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 getindex(::Pair) + tests for Pairs #10152

Merged
merged 1 commit into from
Feb 11, 2015
Merged

Add getindex(::Pair) + tests for Pairs #10152

merged 1 commit into from
Feb 11, 2015

Conversation

quinnj
Copy link
Member

@quinnj quinnj commented Feb 10, 2015

No description provided.

@quinnj
Copy link
Member Author

quinnj commented Feb 10, 2015

Uncontroversial? I thought I'd sweeten the deal by adding tests :).

More controversial was the idea to do

getindex(p::Pair, x::Bool) = ifelse(x,p.first,p.second)

which would allow an alternative ternary syntax like

y = (1=>2)[x in set]

but that might be too confusing.....

@JeffBezanson
Copy link
Member

Yeah I find that pretty obfuscated.

@quinnj
Copy link
Member Author

quinnj commented Feb 10, 2015

Yeah, I think it was cool realizing we could do something like that, but then realizing it's probably not very nice generally.

@quinnj
Copy link
Member Author

quinnj commented Feb 10, 2015

I'm pretty sure the OSX failure is unrelated (timeout while running some package tests?). These passed for me locally on OSX.

@quinnj
Copy link
Member Author

quinnj commented Feb 11, 2015

Looks like the appveyor failure is #10045.

quinnj added a commit that referenced this pull request Feb 11, 2015
Add getindex(::Pair) + tests for Pairs
@quinnj quinnj merged commit d10f7ca into master Feb 11, 2015
@quinnj quinnj deleted the jq/pairindex branch February 25, 2015 17:51
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.

2 participants