# I have a use-case where I have lists of predefined "special" points: usually, thes

**URL:** <https://discourse.julialang.org/t/i-have-a-use-case-where-i-have-lists-of-predefined-special-points-usually-thes/54949>\
**Category:** General Usage\
**Created:** [February 9, 2021, 6:15pm UTC](https://discourse.julialang.org/t/i-have-a-use-case-where-i-have-lists-of-predefined-special-points-usually-thes/54949 "2021-02-09T18:15:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BridgeBot](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bridgebot/32/21491_2.png) [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Post date:** [February 9, 2021, 6:15pm UTC](https://discourse.julialang.org/t/i-have-a-use-case-where-i-have-lists-of-predefined-special-points-usually-thes/54949/1 "2021-02-09T18:15:38Z")

</div>

I have a use-case where I have lists of predefined “special” points: usually, these points are ordinary vectors of floats, but occasionally, they depend on some external variables via some simple algebraic expression, e.g. `[0.0, a*b/c, 0.5]` (with external variables `a`, `b` and `c`). I’m wondering how best to represent such “sometimes-fixed-sometimes-variable” points in Julia?

Naively, I was thinking of something like

```julia
struct VariablePoint
    cnst::Vector{Float64}
    expr::Expr
    is_cnst_or_expr::Bool
end

```

and then defining an overload on `VariablePoint` for input parameters that goes either to `cnst` or `eval(expr)` depending on `is_cnst_or_expr`. That feels wrong though because it needs `eval`.

Note that the original poster on Slack cannot see your response here on Discourse. Consider _transcribing the appropriate answer back to Slack_, or pinging the poster here on Discourse so they can _follow this thread_.  
[(Original message :slack:)](https://julialang.slack.com/archives/C6A044SQH/p1612894078392400?thread_ts=1612894078.392400&cid=C6A044SQH) [(More Info)](https://github.com/JuliaCommunity/SlackBridge)

---

<div class="post-metadata">

**Author:** ![Jeff\_Emanuel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeff_emanuel/32/15440_2.png) [@Jeff\_Emanuel](https://discourse.julialang.org/u/Jeff_Emanuel)\
**Post date:** [February 9, 2021, 7:04pm UTC](https://discourse.julialang.org/t/i-have-a-use-case-where-i-have-lists-of-predefined-special-points-usually-thes/54949/2 "2021-02-09T19:04:51Z")

</div>

Try a function instead of an expression
