Skip to content

Add name keyword to macros #2643

@odow

Description

@odow

Motivated by https://discourse.julialang.org/t/getting-started-mip-variables-and-datastructure/63766/6

It would be nice to have

model = Model()
@variable(model, x[i=1:3], name="x_$(i)")

Currently there is

model = Model()
julia> @variable(model, x[i=1:3], base_name="x_$(i)")
3-element Vector{VariableRef}:
 x_1[1]
 x_2[2]
 x_3[3]

which isn't quite the same thing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: Help WantedHelp is welcome on this issueType: Feature requestgood first issueThis issue is recommended for new users, it does not require a thorough understanding of the package

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions