I wonder if there is a way to have SymEngine hold respect to the variables as they are originally defined in the parent function f? Must be some trick. Maybe someone out there knows.
As @yuyichao said, the heuristic SymEngine is using here to decide on the order of positional arguments is a bit mysterious. I’d say you shouldn’t use the positional arguments like that anyways and instead use the Pair methods:
Also, I should mention that your title is a little misleading. It’s the SymEngine.jl external package that’s causing the mysterious behaviour. This isn’t about julia itself doing something wrong.
Thank you very much for your response also. Sorry about the misleading title. At the time I posted, I wasn’t aware that this was a SymEngine related error until @yuyichao replied . Let me see if there is a way to change it. Sorry but I’m obviously brand new to Julia.
And thank you a second time for the Pair example of using this properly.