# Is there a reason to use \`@expression\`? I think it's redundant

**URL:** <https://discourse.julialang.org/t/is-there-a-reason-to-use-expression-i-think-its-redundant/131829>\
**Category:** Optimization (Mathematical)\
**Tags:** question, jump, gurobi\
**Created:** [August 25, 2025, 8:33am UTC](https://discourse.julialang.org/t/is-there-a-reason-to-use-expression-i-think-its-redundant/131829 "2025-08-25T08:33:43Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![WalterMadelim](https://avatars.discourse-cdn.com/v4/letter/w/3e96dc/32.png) [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Post date:** [September 22, 2025, 6:53am UTC](https://discourse.julialang.org/t/is-there-a-reason-to-use-expression-i-think-its-redundant/131829/9 "2025-09-22T06:53:05Z")

</div>

Is this a bug?

```julia
julia> import JuMP

julia> model = JuMP.Model();

julia> x = map(_ -> JuMP.@variable(model), 1) # returns a SCALAR
_[1]

julia> ndims(x), ndims(1)
(0, 0)

julia> map(_ -> JuMP.@variable(model), x) # returns a Vector???
1-element Vector{JuMP.VariableRef}:
 _[2]

```

I think the last return should be `_[2]` solely, not wrapped in a Vector.  
Yes, surely I think `_[2]` should be the expected return, otherwise duplicating the following:

```julia
julia> model = JuMP.Model();

julia> x = map(_ -> JuMP.@variable(model), 1)
_[1]

julia> map(_ -> JuMP.@variable(model), [x])
1-element Vector{JuMP.VariableRef}:
 _[2]

```

The julia’s behavior is sane:

```julia-auto
julia> map(_ -> 1, 2)
1

julia> map(_ -> 1, [2])
1-element Vector{Int64}:
 1

```

---

_[View the full topic](https://discourse.julialang.org/t/is-there-a-reason-to-use-expression-i-think-its-redundant/131829)._
