jump-dev / AmplNLWriter.jl

A Julia interface to AMPL-enabled solvers
http://ampl.com/products/solvers/all-solvers-for-ampl/
MIT License
65 stars 18 forks source link

Fix empty options #148

Closed odow closed 2 years ago

odow commented 2 years ago

From https://discourse.julialang.org/t/amplnlwriter-no-longer-works-with-jump/70740/2

Things were currently working because

julia> options = Dict{String,Any}()
Dict{String, Any}()

julia> [isempty(v) ? k : "$(k)=$(v)" for (k, v) in options]
String[]

But maybe this doesn't hold on every Julia version or machine type. Anyway, we shouldn't be relying on inference to determine this correctly.

Closes #147