Being relatively new to Julia, I wrote something like the code below and stumbled on undefined behavior. Since the code below does not use the correct
expr.subs() syntax, shouldn’t it issue an error message or warning?
@syms x y
f = x + y^2
can result in both 3 and 5.
It isn’t undefined, though it is arbitrarily defined: when specified in this way, the ordering follows that returned by
free_symbols which sorts the string value of each symbol. It could be better documented, though I’d suggest being explicit, as in
free_symbols always return the same order of x and y?
Yes, though it relies on string sorting which might give unexpected order.