How can I view the minimal required arguments of a Wolfram Language function?
Clash Royale CLAN TAG#URR8PPP
up vote
11
down vote
favorite
This question might be a bit of an overstretch, or really obvious, but I haven't been able to find an answer yet.
Is there a way to automatically view the minimum required arguments for a WL function? For example, Sin
only requires 1 argument, while Replace
requires both an expression and the list of rules. Is there a way that, for example, I can input Sin
into a function, and get back something like Real
, or enter Replace
, and get back Expression, Rules
?
I hope this makes sense - I would like to be able to automate input to any function in Mathematica, by being given the required arguments.
Thanks!
functions input arguments
add a comment |Â
up vote
11
down vote
favorite
This question might be a bit of an overstretch, or really obvious, but I haven't been able to find an answer yet.
Is there a way to automatically view the minimum required arguments for a WL function? For example, Sin
only requires 1 argument, while Replace
requires both an expression and the list of rules. Is there a way that, for example, I can input Sin
into a function, and get back something like Real
, or enter Replace
, and get back Expression, Rules
?
I hope this makes sense - I would like to be able to automate input to any function in Mathematica, by being given the required arguments.
Thanks!
functions input arguments
3
Is there a way to automatically view the minimum
You might be able to parse it out from the output ofInformation[functionName]
, It will list all the different signatures of the function there, one per line.
– Nasser
yesterday
That's a good idea, however, when I try val = Information[Replace], and then view the results with ?val, it returns that val = Null
– Jmeeks29ig
yesterday
1
@Jmeeks29igInformation
has side effects and doesn't return anything. Fortunately we can scrape the side effects withBlock[CellPrint = Sow, Reap[Information[Replace]][[-1, 1]]]
. HoweverReplace::usage
would be an easier way to see the information your after.
– Chip Hurst
21 hours ago
Great, thanks! I hadn't known that was possible
– Jmeeks29ig
14 hours ago
add a comment |Â
up vote
11
down vote
favorite
up vote
11
down vote
favorite
This question might be a bit of an overstretch, or really obvious, but I haven't been able to find an answer yet.
Is there a way to automatically view the minimum required arguments for a WL function? For example, Sin
only requires 1 argument, while Replace
requires both an expression and the list of rules. Is there a way that, for example, I can input Sin
into a function, and get back something like Real
, or enter Replace
, and get back Expression, Rules
?
I hope this makes sense - I would like to be able to automate input to any function in Mathematica, by being given the required arguments.
Thanks!
functions input arguments
This question might be a bit of an overstretch, or really obvious, but I haven't been able to find an answer yet.
Is there a way to automatically view the minimum required arguments for a WL function? For example, Sin
only requires 1 argument, while Replace
requires both an expression and the list of rules. Is there a way that, for example, I can input Sin
into a function, and get back something like Real
, or enter Replace
, and get back Expression, Rules
?
I hope this makes sense - I would like to be able to automate input to any function in Mathematica, by being given the required arguments.
Thanks!
functions input arguments
functions input arguments
edited yesterday
kglr
159k8184384
159k8184384
asked yesterday
Jmeeks29ig
1725
1725
3
Is there a way to automatically view the minimum
You might be able to parse it out from the output ofInformation[functionName]
, It will list all the different signatures of the function there, one per line.
– Nasser
yesterday
That's a good idea, however, when I try val = Information[Replace], and then view the results with ?val, it returns that val = Null
– Jmeeks29ig
yesterday
1
@Jmeeks29igInformation
has side effects and doesn't return anything. Fortunately we can scrape the side effects withBlock[CellPrint = Sow, Reap[Information[Replace]][[-1, 1]]]
. HoweverReplace::usage
would be an easier way to see the information your after.
– Chip Hurst
21 hours ago
Great, thanks! I hadn't known that was possible
– Jmeeks29ig
14 hours ago
add a comment |Â
3
Is there a way to automatically view the minimum
You might be able to parse it out from the output ofInformation[functionName]
, It will list all the different signatures of the function there, one per line.
– Nasser
yesterday
That's a good idea, however, when I try val = Information[Replace], and then view the results with ?val, it returns that val = Null
– Jmeeks29ig
yesterday
1
@Jmeeks29igInformation
has side effects and doesn't return anything. Fortunately we can scrape the side effects withBlock[CellPrint = Sow, Reap[Information[Replace]][[-1, 1]]]
. HoweverReplace::usage
would be an easier way to see the information your after.
– Chip Hurst
21 hours ago
Great, thanks! I hadn't known that was possible
– Jmeeks29ig
14 hours ago
3
3
Is there a way to automatically view the minimum
You might be able to parse it out from the output of Information[functionName]
, It will list all the different signatures of the function there, one per line.– Nasser
yesterday
Is there a way to automatically view the minimum
You might be able to parse it out from the output of Information[functionName]
, It will list all the different signatures of the function there, one per line.– Nasser
yesterday
That's a good idea, however, when I try val = Information[Replace], and then view the results with ?val, it returns that val = Null
– Jmeeks29ig
yesterday
That's a good idea, however, when I try val = Information[Replace], and then view the results with ?val, it returns that val = Null
– Jmeeks29ig
yesterday
1
1
@Jmeeks29ig
Information
has side effects and doesn't return anything. Fortunately we can scrape the side effects with Block[CellPrint = Sow, Reap[Information[Replace]][[-1, 1]]]
. However Replace::usage
would be an easier way to see the information your after.– Chip Hurst
21 hours ago
@Jmeeks29ig
Information
has side effects and doesn't return anything. Fortunately we can scrape the side effects with Block[CellPrint = Sow, Reap[Information[Replace]][[-1, 1]]]
. However Replace::usage
would be an easier way to see the information your after.– Chip Hurst
21 hours ago
Great, thanks! I hadn't known that was possible
– Jmeeks29ig
14 hours ago
Great, thanks! I hadn't known that was possible
– Jmeeks29ig
14 hours ago
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
12
down vote
accepted
You can use SyntaxInformation
:
SyntaxInformation /@ Sin, Replace // Column
It works - thanks!!!
– Jmeeks29ig
yesterday
1
@Jmeeks29ig, you are most welcome.
– kglr
yesterday
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
12
down vote
accepted
You can use SyntaxInformation
:
SyntaxInformation /@ Sin, Replace // Column
It works - thanks!!!
– Jmeeks29ig
yesterday
1
@Jmeeks29ig, you are most welcome.
– kglr
yesterday
add a comment |Â
up vote
12
down vote
accepted
You can use SyntaxInformation
:
SyntaxInformation /@ Sin, Replace // Column
It works - thanks!!!
– Jmeeks29ig
yesterday
1
@Jmeeks29ig, you are most welcome.
– kglr
yesterday
add a comment |Â
up vote
12
down vote
accepted
up vote
12
down vote
accepted
You can use SyntaxInformation
:
SyntaxInformation /@ Sin, Replace // Column
You can use SyntaxInformation
:
SyntaxInformation /@ Sin, Replace // Column
edited yesterday
answered yesterday
kglr
159k8184384
159k8184384
It works - thanks!!!
– Jmeeks29ig
yesterday
1
@Jmeeks29ig, you are most welcome.
– kglr
yesterday
add a comment |Â
It works - thanks!!!
– Jmeeks29ig
yesterday
1
@Jmeeks29ig, you are most welcome.
– kglr
yesterday
It works - thanks!!!
– Jmeeks29ig
yesterday
It works - thanks!!!
– Jmeeks29ig
yesterday
1
1
@Jmeeks29ig, you are most welcome.
– kglr
yesterday
@Jmeeks29ig, you are most welcome.
– kglr
yesterday
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f181720%2fhow-can-i-view-the-minimal-required-arguments-of-a-wolfram-language-function%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
3
Is there a way to automatically view the minimum
You might be able to parse it out from the output ofInformation[functionName]
, It will list all the different signatures of the function there, one per line.– Nasser
yesterday
That's a good idea, however, when I try val = Information[Replace], and then view the results with ?val, it returns that val = Null
– Jmeeks29ig
yesterday
1
@Jmeeks29ig
Information
has side effects and doesn't return anything. Fortunately we can scrape the side effects withBlock[CellPrint = Sow, Reap[Information[Replace]][[-1, 1]]]
. HoweverReplace::usage
would be an easier way to see the information your after.– Chip Hurst
21 hours ago
Great, thanks! I hadn't known that was possible
– Jmeeks29ig
14 hours ago