# How to add a Feature in Julia Lang

**URL:** https://discourse.julialang.org/t/how-to-add-a-feature-in-julia-lang/50325
**Category:** Internals & Design
**Tags:** question
**Created:** [November 17, 2020, 7:59pm UTC](https://discourse.julialang.org/t/how-to-add-a-feature-in-julia-lang/50325 "2020-11-17T19:59:43Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Impressium](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/impressium/32/19575_2.png) [@Impressium](https://discourse.julialang.org/u/Impressium)
#### Post date: [November 17, 2020, 7:59pm UTC](https://discourse.julialang.org/t/how-to-add-a-feature-in-julia-lang/50325/1 "2020-11-17T19:59:43Z")

</div>

I would like to use `Set`s like this:

```julia
julia> Set(1,2,3)
Set{Int64} with 3 elements:
  2
  3
  1

```

I want to add one overload.

```julia
julia> Set(args::T...) where T = Set(args)
Set
julia> Set(args::Any...) = Set(args)
 Set

```

How would I propose that (on Github)?

---

<div class="post-metadata">

### Author: ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)
#### Post date: [November 17, 2020, 8:13pm UTC](https://discourse.julialang.org/t/how-to-add-a-feature-in-julia-lang/50325/2 "2020-11-17T20:13:27Z")

</div>

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`?

---

<div class="post-metadata">

### Author: ![Mason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mason/32/2423_2.png) [@Mason](https://discourse.julialang.org/u/Mason)
#### Post date: [November 17, 2020, 8:13pm UTC](https://discourse.julialang.org/t/how-to-add-a-feature-in-julia-lang/50325/3 "2020-11-17T20:13:29Z")

</div>

First search the github issue tracker [Issues · JuliaLang/julia · GitHub](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) [Sign in to GitHub · GitHub](https://github.com/JuliaLang/julia/issues/new)

Once the idea has been discussed, you then fork the julia repo on github

 ![image](https://global.discourse-cdn.com/julialang/original/3X/0/b/0b2a590f31a7bcf1d0d4b15f42f58ecb5ef7f8f8.png)

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

 ![image](https://global.discourse-cdn.com/julialang/original/3X/7/d/7d6cb9abe536a8ee0cf310431c543d5a09cd85c2.png)

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.

---

<div class="post-metadata">

### Author: ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)
#### Post date: [November 17, 2020, 8:16pm UTC](https://discourse.julialang.org/t/how-to-add-a-feature-in-julia-lang/50325/4 "2020-11-17T20:16:19Z")

</div>

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. 🙂

---

<div class="post-metadata">

### Author: ![simeonschaub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simeonschaub/32/216566_2.png) [@simeonschaub](https://discourse.julialang.org/u/simeonschaub)
#### Post date: [November 17, 2020, 8:16pm UTC](https://discourse.julialang.org/t/how-to-add-a-feature-in-julia-lang/50325/5 "2020-11-17T20:16:42Z")

</div>

You might want to check out @kslimes’s awesome tutorial on how to start contributing to Julia: [Making a first Julia pull request | Katharine Hyatt](https://kshyatt.github.io/post/firstjuliapr/)

---

<div class="post-metadata">

### Author: ![Impressium](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/impressium/32/19575_2.png) [@Impressium](https://discourse.julialang.org/u/Impressium)
#### Post date: [November 17, 2020, 8:23pm UTC](https://discourse.julialang.org/t/how-to-add-a-feature-in-julia-lang/50325/6 "2020-11-17T20:23:10Z")

</div>

Ahh, didn’t think of that. That’s actually a good point

---

<div class="post-metadata">

### Author: ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)
#### Post date: [November 17, 2020, 8:29pm UTC](https://discourse.julialang.org/t/how-to-add-a-feature-in-julia-lang/50325/7 "2020-11-17T20:29:39Z")

</div>

Here you go:

[https://github.com/JuliaLang/julia/pull/22477](https://github.com/JuliaLang/julia/pull/22477)

---

<div class="post-metadata">

### Author: ![Mason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mason/32/2423_2.png) [@Mason](https://discourse.julialang.org/u/Mason)
#### Post date: [November 17, 2020, 8:33pm UTC](https://discourse.julialang.org/t/how-to-add-a-feature-in-julia-lang/50325/8 "2020-11-17T20:33:04Z")

</div>

One thing you _can_ do is define your own factory function, e.g.

```julia
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
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)

```

and

```julia
julia> Tuple((1,2,3))
(1, 2, 3)

julia> tuple((1,2,3))
((1, 2, 3),)

```
