# What lowers to hvcat(::Int, ...)?

**URL:** https://discourse.julialang.org/t/what-lowers-to-hvcat-int/121107
**Category:** Internals & Design
**Tags:** question, syntax
**Created:** [October 9, 2024, 2:04pm UTC](https://discourse.julialang.org/t/what-lowers-to-hvcat-int/121107 "2024-10-09T14:04:07Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [October 9, 2024, 2:04pm UTC](https://discourse.julialang.org/t/what-lowers-to-hvcat-int/121107/1 "2024-10-09T14:04:07Z")

</div>

I am curious what syntax lowers to `hvcat(::Int, ...)`.

Everything I tried lowers into the `hvcat(::Tuple{Vararg{Int}}, ...)` form. An example would be useful.

---

<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: [October 9, 2024, 2:10pm UTC](https://discourse.julialang.org/t/what-lowers-to-hvcat-int/121107/2 "2024-10-09T14:10:48Z")

</div>

What makes you think something does? And why are you curious? I think it might be vestigial.

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [October 9, 2024, 2:13pm UTC](https://discourse.julialang.org/t/what-lowers-to-hvcat-int/121107/3 "2024-10-09T14:13:56Z")

</div>

> [@mbauman](#):
>
> And why are you curious?

I was assuming that it had a purpose but could not figure it out from reading the code.

> [@mbauman](#):
>
> I think it might be vestigial.

In that case, would it make sense to remove it?

(It may look innocuous, but if the user follows the docstring of `hvcat` and defines a method for that, that is wasted effort).

---

<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: [October 9, 2024, 3:26pm UTC](https://discourse.julialang.org/t/what-lowers-to-hvcat-int/121107/5 "2024-10-09T15:26:40Z")

</div>

But it’s also an exported and documented function that anyone can _manually_ call, whether it’s generated by some literal syntax or not. And folks [do](https://juliahub.com/ui/Search?type=symbols&q=hvcat&u=use).

Removing that has a nonzero cost, too.

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [October 9, 2024, 3:37pm UTC](https://discourse.julialang.org/t/what-lowers-to-hvcat-int/121107/6 "2024-10-09T15:37:25Z")

</div>

Thanks for looking into examples, indeed it is used so removing it would not be a good idea.

A PR could just clarify that lowering is always to the other form. I did not open a new issue for this, but added a note to

> <https://github.com/JuliaLang/julia/issues/51509>
>
> While \`Base.hvcat\` is part of the API, \`Base.typed\_hvcat\` apparently isn't, and …while the manual \[does not mention\](https://docs.julialang.org/en/v1/manual/arrays/#man-array-typed-literal) what \`T\[...; ...\]\` is lowered to.
> 
> I propose the following:
> 
> 1. add a docstring to \`typed\_hvcat\`, explain what is lowered to it, and make it part of the docs (potentially by not exporting it, \`public\` should be enough),
> 2. mention the lowering in the docs section linked above.
> 
> I will wait for comments and then make a PR.
