-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
splat
rename 1.8 -> 1.9
#47714
Comments
Looks like that was introduced by #42717, not sure why capitalization was changed though |
cc @Seelengrab |
I'm a bit surprised that the change in capitalization (even without change in functionality!) is controversial :)
That's not quite true - [sukera@tempman ~]$ julia -q --depwarn=yes
julia> versioninfo()
Julia Version 1.10.0-DEV.6
Commit 4cf077cd9a (2022-11-14 21:07 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: 4 × Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-14.0.6 (ORCJIT, skylake)
Threads: 4 on 4 virtual cores
Environment:
JULIA_NUM_THREADS = 4
julia> f() = Base.splat(+)
f (generic function with 1 method)
julia> f()
┌ Warning: `splat(x)` is deprecated, use `Splat(x)` instead.
│ caller = f() at REPL[1]:1
└ @ Main ./REPL[1]:1
Splat(+) That's also the rationale for changing the capitalization, to signify that it's a bit more of a complicated object than just an anonymous function. Since its idiomatic to have struct names capitalized, this is too, similar to Though I'm open to not having the deprecation and just having it forward to |
I mean that in 1.9
Structs are capitalized, true. But this doesn't have anything to do with how they are created, what's the actual API. There's no shortage of examples where a struct (capitalized) isn't typically created with its constructor, but with a dedicated (lowercase) function. The function can either do some basic preprocessing of its arguments, or just pass them as-is to the constructor: julia> zip([], [])
zip(Any[], Any[])
julia> zip([], []) |> typeof
Base.Iterators.Zip{Tuple{Vector{Any}, Vector{Any}}}
julia> Iterators.filter(identity, [])
Base.Iterators.Filter{typeof(identity), Vector{Any}}(identity, Any[])
I don't see any more consistency in calling |
In any case, any version of |
That too can be solved with e.g. JuliaLang/Compat.jl#785, which should be used if you want new features on an older version once it is merged. That's pretty much how it has always worked.
I'm aware of that, and I think it's a mistake that e.g.
I'm not sure I follow why adding a new thing implies renaming the new thing in the future. What exactly is the issue here, aside from aesthetic reasons? |
Compat seems to have become a bit of an albatross from what I hear, so not sure if that is the perfect answer That said, I don't think the name change is a big problem personally -- though I do still personally have a strong preference carried over from the pre 1.0 days for never breaking anything just for aesthetic reasons, so would probably personally lean towards keeping the lower-cased name for the |
Yes, exactly. Nothing breaks due to this, so from what I understand this is purely due to wanting to use the pretty printing on a version prior to 1.9 (understandable, since I'd have preferred to use it earlier too, else I wouldn't have made a PR for this UX in the first place!). If it's really desired, I guess we can discuss it on triage? |
At least I didn't imply anything like this - no changes to older versions, they are fine as-is. I'll try to explain my point again, there seems to be some confusion.
The question is, why not make I bet that most of the users (who need it) would continue using
Why add an extra dependency, when just using
How does this have anything to do with lower/upper case? Current |
Anyway, this isn't a major issue, so I'll stop here. I just surely will continue using |
Ok, I suppose we can close this, but if anyone wants to make a PR to adjust the docs or make the fallback permanent they can do that |
@brenhinkeller, do you mean that I can make a PR to restore I would be happy to make such a PR if there's a chance to have it merged. It seems very natural to keep
I agree with @aplavin: this rename is unnecessary and is just going to add confusion. We will forever have a mix of |
Sure! |
Triage thinks we should keep the lower case |
Closed by #48038 |
In Julia 1.9:
Meanwhile,
Base.splat
remains, and seems equivalent toBase.Splat
- but not documented. It's hard to see the rationale for changing the name to capital case.The current situation is that
Base.splat
is available in both earlier julia versions and in 1.9, whileBase.Splat
only in 1.9. Given that, I find it hard to imagine someone usingBase.Splat
--Base.splat
has the same behavior and remains compatible with 1.8-.Maybe, while 1.9 is not released yet,
Base.splat
should be documented as the official function splatting instead ofBase.Splat
?The text was updated successfully, but these errors were encountered: