Message Boards Message Boards

GROUPS:

View user defined function definitions?

Posted 9 months ago
545 Views
|
4 Replies
|
2 Total Likes
|

Is there a method for viewing the definition and arguments for a user defined function in Wolfram Language?

4 Replies
Posted 9 months ago

Definition is excellent - thanks!

Posted 9 months ago

Also

Definition@f

f[x_?(x>=0&)]:=Sqrt[x]     
f[x_]:=x

This will open a new notebook with the definitions.

Needs["GeneralUtilities`"]
PrintDefinitions@f

Global`f[PatternTest[Pattern[x, Blank[]], Function[GreaterEqual[x, 0]]]] := Sqrt @ x;
Global`f[Pattern[x, Blank[]]] := x;
Posted 9 months ago

Excellent - thank you for your help.

Posted 9 months ago

Hi Don,

f[x_] := x;
f[x_?(x >= 0 &)] := Sqrt[x]

Information@f

enter image description here

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract