This is actually how sets used to work, if I remember right. The problem â and the reason why it was deprecated â is that it introduces a confusion between what Set(1:2) means: is it what itâd mean if it were a part of Set(1:2, 3:4)? Is it the set with a single 1:2 element or is it the Set with a 1 and a 2?
First search the github issue tracker https://github.com/JuliaLang/julia/issues for related issue or discussions about something related to your proposal. This is vital so that you donât waste your time, or the time of the julia devs. Iâve been guilty a few times now of proposing something only to find out that there was already several old discussions that I missed previously.
The second step is to open an issue to propose and discuss your change (this is not strictly necessary, but is often a good idea so you donât waste effort making something that is unacceptable) https://github.com/JuliaLang/julia/issues/new
Once the idea has been discussed, you then fork the julia repo on github
See the fork button on the top right? Click that. Next, you make the changes you want to propose in your forked copy of the julia repo, and then you will see a bar in your copy
that says âpull requestâ. Click that, and it will allow you to open whatâs called a pull request to the julia repo and then people can discuss your specific implementation of the proposed idea.
Finally, itâs important to be humble and understanding when people criticize your proposal. I like to think Iâm pretty good at receiving criticism, but sometimes, when I work on something that I think is cool or clever, itâs really hard to hear someone you respect say that it is a bad idea or that they disagree with it. Itâs important to remember that Julia is a language used by many different people and they all have deep stakes in it, so proposals must go through rigorous discussion before theyâre accepted. The people reviewing these proposals are often very knowledgeable, and see many proposals every day. We all have to do our best to not take it personally when our ideas donât work out.
In other words, itâs really valuable to do a bit of searching to see if itâs been proposed before and if there have been any prior discussions or decisions before investing to much energy into the idea.
One thing you can do is define your own factory function, e.g.
julia> set(args...) = Set(args)
set (generic function with 1 method)
julia> set(1,2,3)
Set{Int64} with 3 elements:
2
3
1
This way, the Set constructor is unchanged and thereâs no ambiguity with it, but you can also have the constructor you want. This is a rather common pattern that ends up being needed. For instance Tuple versus tuple:
julia> Tuple(1,2,3)
ERROR: MethodError: no method matching Tuple(::Int64, ::Int64, ::Int64)
Closest candidates are:
Tuple(::Any) where T<:Tuple at tuple.jl:230
Stacktrace:
[1] top-level scope at REPL[6]:1
julia> tuple(1,2,3)
(1, 2, 3)