Skip to content

Inferrable ntuple without generated functions #15578

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

Merged
merged 1 commit into from
Mar 29, 2016
Merged

Conversation

timholy
Copy link
Member

@timholy timholy commented Mar 21, 2016

The trick seems to be adding the ::F type parameter, see #15456. Third time's the charm 😄.

end
# inferrable ntuple
function ntuple{F,N}(f::F, ::Type{Val{N}})
check_parameter_type(Int, N, :ntuple)
Copy link
Member

Choose a reason for hiding this comment

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

This can be done with Core.typeassert(N, Int).

@JeffBezanson
Copy link
Member

👍

@timholy
Copy link
Member Author

timholy commented Mar 22, 2016

I just realized how much similarity this has with your #15516, though AFAICT there isn't actual overlap.

@timholy timholy merged commit 64be4ee into master Mar 29, 2016
@timholy timholy deleted the teh/lispy_ntuple branch March 29, 2016 10:45
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