symbolic icon indicating copy to clipboard operation
symbolic copied to clipboard

diff(symfun) should respect `@symfun/symvar` ordering

Open cbm755 opened this issue 8 years ago • 3 comments

@sym/symvar and @symfun/symvar are subtly different (as documented).

diff(f) where f is a symfun should use @symfun/symvar, but it looks like it does not:

syms f(g, h)
diff(f)
ans(g, h) = (symfun)

  ∂          
  ──(f(g, h))
  ∂h         

I think that should be w.r.t. g because:

symvar(f, 1)
ans = (sym) g

cbm755 avatar Sep 14 '16 20:09 cbm755

So in @symvar/diff we call diff(f.sym, ...) (effectively casting to @sym).

I think instead we should call the superclass method @sym/diff on f itself.

If this was classdef, that should be diff@sym(f, ...). But how do we accomplish that with old-style classes?

@mtmiller do you happen to know how to call a superclass method in old-style classes?

cbm755 avatar Sep 14 '16 21:09 cbm755

No sorry

mtmiller avatar Sep 14 '16 22:09 mtmiller

might punt this until we are based on classdef (#545) and see if it can be easily fixed after that.

cbm755 avatar Sep 14 '16 22:09 cbm755