How to access the variable accessible by a closure?

Maybe a better way but they are just stored as fields

julia> propertynames(g)
(:a,)

e.g.

julia> g.a
2.0

I’m not sure if doing this is public API if that matters to you

1 Like