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

allow splatting in calls to `new` #30577

Merged
merged 2 commits into from Feb 7, 2019

Conversation

@JeffBezanson
Copy link
Member

commented Jan 3, 2019

This allows the core NamedTuple constructor to be defined without generated functions.
With a bit of work in the front end it will also allow splatting inside new in general, which is kind of a neat feature. Done!

Unfortunately this does not yet do much for named tuples of Unions, but it's heading in the right direction.

@Keno

This comment has been minimized.

Copy link
Member

commented Jan 4, 2019

You'll want to teach SROA about this also

@JeffBezanson

This comment has been minimized.

Copy link
Member Author

commented Jan 4, 2019

I hoped it would be enough to inline this to a normal :new expression when the length is known, and otherwise just let it be slow. Is there something else I should do more specifically?

@Keno

This comment has been minimized.

Copy link
Member

commented Jan 4, 2019

Yeah, I guess that's ok for now. There's fancier things one could do of course, but maybe that's future work.

@JeffBezanson JeffBezanson force-pushed the jb/splatnew branch from d81be12 to 10ebb97 Jan 4, 2019

@JeffBezanson JeffBezanson changed the title RFC: add `splatnew` form; like `new` but accepts a tuple allow splatting in calls to `new` Jan 4, 2019

@JeffBezanson JeffBezanson force-pushed the jb/splatnew branch from b45cfda to 32de7f1 Jan 24, 2019

@JeffBezanson JeffBezanson force-pushed the jb/splatnew branch 4 times, most recently from d3729f9 to c2cb02e Feb 2, 2019

JeffBezanson added 2 commits Feb 2, 2019
implement splatting in `new` calls
adds `splatnew` form; like `new` but accepts a tuple

@JeffBezanson JeffBezanson force-pushed the jb/splatnew branch from c2cb02e to e456a72 Feb 7, 2019

@JeffBezanson JeffBezanson merged commit 2ecc499 into master Feb 7, 2019

2 of 3 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
julia freebsd ci Build done
Details

@JeffBezanson JeffBezanson deleted the jb/splatnew branch Feb 7, 2019

lcw added a commit to lcw/TypedTables.jl that referenced this pull request Mar 19, 2019
Version check workaround for JuliaLang/julia#29970
The workaround for JuliaLang/julia#29970 causes newer versions of Julia
to hang in the precompilation step for TypedTables.

Since JuliaLang/julia#29970 has been addressed in JuliaLang/julia#30577
the code is avoided in newer versions of Julia.
chakravala added a commit to chakravala/julia that referenced this pull request Apr 4, 2019
@vchuravy vchuravy referenced this pull request May 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.