ahumenberger / Z3.jl

Julia interface to Z3
MIT License
57 stars 7 forks source link

Do not export `ctx`, or use different variable in the examples #13

Open goretkin opened 4 years ago

goretkin commented 4 years ago

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
ahumenberger commented 4 years ago

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?

goretkin commented 4 years ago

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.