Z3.jl
Z3.jl copied to clipboard
Do not export `ctx`, or use different variable in the examples
Z3.ctx
is a function, however the example in the README shadows it.
using Z3
ctx = Context()
This can be a problem:
julia> ctx
ctx (generic function with 2 methods)
julia> ctx = Z3.Context()
ERROR: cannot assign a value to variable Z3.ctx from module Main
Thanks for the hint! Z3.ctx
is actually a function coming from the Z3 API, and ctx
is often used as a variable name. I was thinking about aliasing Z3.ctx
by Z3.context
and just exporting the latter. What do you think?
I think that's a pretty decent solution.
I think, at least under some namespace, the Julia bindings should be kept as consistent as possible with the Z3 API, so that documentation for the latter can help with the former. Keeping Z3.ctx
, but not exporting it, is consistent with that.