I have a very long code that may have errors in definition of functions and I want to trace these errors.

Is there any attribute or function to detect whether a function is initially defined in the form of function[x_,y_] or function[x,y] or any other form without searching to find the place of initial definition?

  • 3
    $\begingroup$ Look at DownValues[function]? $\endgroup$
    – MarcoB
    Dec 4, 2021 at 19:45
  • $\begingroup$ That's great! Can I modify this attribute for functions? For example I have a function defined in the form W[x,y] within an expression and I want to temporary change the definition form of it to W[x_,y_] for a special use. @MarcoB $\endgroup$
    – Alex97
    Dec 4, 2021 at 19:53
  • $\begingroup$ Look also at the color of the function name. Undeclared names are blue. $\endgroup$ Dec 4, 2021 at 20:20


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.