# Vcat for Vector{Any}

**URL:** https://discourse.julialang.org/t/vcat-for-vector-any/111065
**Category:** New to Julia
**Tags:** vector, cat
**Created:** [March 2, 2024, 3:51pm UTC](https://discourse.julialang.org/t/vcat-for-vector-any/111065 "2024-03-02T15:51:20Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Enlil50](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/enlil50/32/206539_2.png) [@Enlil50](https://discourse.julialang.org/u/Enlil50)
#### Post date: [March 2, 2024, 3:51pm UTC](https://discourse.julialang.org/t/vcat-for-vector-any/111065/1 "2024-03-02T15:51:20Z")

</div>

I have this part of code:

```julia
#can't be change
len::Int64 = 4
a = rand(Float64, len)
a_1 = Int64.(floor.(@view a[1:2:len]))
a_2 = @view a[2:2:len]

display(a_1)

#can be changed
b = vcat[Vector{Any}(a_1), a_2]

```

It throws this error:

```julia
ERROR: LoadError: syntax: unexpected semicolon in array expression around /home/matteobacci/Desktop/Programmi/MODULO_05/executable_and_libraries/bin/aa.jl:95
Stacktrace:

```

I want to concatenate the views of these array. Do I need to drop the view?  
They could be pretty long arrays and I don’t want too much stuff on the computer.

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [March 2, 2024, 3:57pm UTC](https://discourse.julialang.org/t/vcat-for-vector-any/111065/2 "2024-03-02T15:57:39Z")

</div>

> [@Enlil50](#):
>
> `vcat[Vector{Any}(a_1), a_2]`

You need parentheses to call `vcat`, i.e.

```julia
vcat(Vector{Any}(a_1), a_2)

```

Alternatively, you can use square brackets with a semicolon, and no `vcat`, which implicitly calls `vcat`:

```julia
[Vector{Any}(a_1); a_2]

```

> [@Enlil50](#):
>
> ```julia
> ERROR: LoadError: syntax: unexpected semicolon in array expression around /home/matteobacci/Desktop/Programmi/MODULO_05/executable_and_libraries/bin/aa.jl:95
> 
> ```

Your code doesn’t give that error for me. The error message that I get from your code with `vcat[...]` is

```julia
ERROR: MethodError: no method matching getindex(::typeof(vcat), ...)

```

which makes sense because `vcat[...]` is equivalent to `getindex(vcat, ...)`.
