What does _. mean in patterns?
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
Here is a quick one, hopefully. I searched through different tutorials and documentation articles but haven't been able to find anything yet.
What does _.
mean? As in _,_.
as opposed to _,_
or _,_,_.
as opposed to _,_,_
?
Thanks!
pattern-matching argument-patterns
 |Â
show 1 more comment
up vote
3
down vote
favorite
Here is a quick one, hopefully. I searched through different tutorials and documentation articles but haven't been able to find anything yet.
What does _.
mean? As in _,_.
as opposed to _,_
or _,_,_.
as opposed to _,_,_
?
Thanks!
pattern-matching argument-patterns
I may have found it - it might represent Default, but I have to do some more reading.
â Jmeeks29ig
2 hours ago
That seems to make sense. I am trying to use it in context of pattern matching, using SyntaxInformation, to get the required arguments of some random function, and then insert values into the function in the proper order
â Jmeeks29ig
2 hours ago
@Szabolcs You forgota /. coef_. a :> coef
:)
â xzczd
2 hours ago
1
@xzczd You are right. I deleted my comment (it was incorrect).
â Szabolcs
2 hours ago
2
"I searched through different tutorials and documentation articles but haven't been able to find anything yet." Then you haven't yet learned the correct usage of document: i.stack.imgur.com/RVvvv.gif
â xzczd
2 hours ago
 |Â
show 1 more comment
up vote
3
down vote
favorite
up vote
3
down vote
favorite
Here is a quick one, hopefully. I searched through different tutorials and documentation articles but haven't been able to find anything yet.
What does _.
mean? As in _,_.
as opposed to _,_
or _,_,_.
as opposed to _,_,_
?
Thanks!
pattern-matching argument-patterns
Here is a quick one, hopefully. I searched through different tutorials and documentation articles but haven't been able to find anything yet.
What does _.
mean? As in _,_.
as opposed to _,_
or _,_,_.
as opposed to _,_,_
?
Thanks!
pattern-matching argument-patterns
pattern-matching argument-patterns
asked 2 hours ago
Jmeeks29ig
3066
3066
I may have found it - it might represent Default, but I have to do some more reading.
â Jmeeks29ig
2 hours ago
That seems to make sense. I am trying to use it in context of pattern matching, using SyntaxInformation, to get the required arguments of some random function, and then insert values into the function in the proper order
â Jmeeks29ig
2 hours ago
@Szabolcs You forgota /. coef_. a :> coef
:)
â xzczd
2 hours ago
1
@xzczd You are right. I deleted my comment (it was incorrect).
â Szabolcs
2 hours ago
2
"I searched through different tutorials and documentation articles but haven't been able to find anything yet." Then you haven't yet learned the correct usage of document: i.stack.imgur.com/RVvvv.gif
â xzczd
2 hours ago
 |Â
show 1 more comment
I may have found it - it might represent Default, but I have to do some more reading.
â Jmeeks29ig
2 hours ago
That seems to make sense. I am trying to use it in context of pattern matching, using SyntaxInformation, to get the required arguments of some random function, and then insert values into the function in the proper order
â Jmeeks29ig
2 hours ago
@Szabolcs You forgota /. coef_. a :> coef
:)
â xzczd
2 hours ago
1
@xzczd You are right. I deleted my comment (it was incorrect).
â Szabolcs
2 hours ago
2
"I searched through different tutorials and documentation articles but haven't been able to find anything yet." Then you haven't yet learned the correct usage of document: i.stack.imgur.com/RVvvv.gif
â xzczd
2 hours ago
I may have found it - it might represent Default, but I have to do some more reading.
â Jmeeks29ig
2 hours ago
I may have found it - it might represent Default, but I have to do some more reading.
â Jmeeks29ig
2 hours ago
That seems to make sense. I am trying to use it in context of pattern matching, using SyntaxInformation, to get the required arguments of some random function, and then insert values into the function in the proper order
â Jmeeks29ig
2 hours ago
That seems to make sense. I am trying to use it in context of pattern matching, using SyntaxInformation, to get the required arguments of some random function, and then insert values into the function in the proper order
â Jmeeks29ig
2 hours ago
@Szabolcs You forgot
a /. coef_. a :> coef
:)â xzczd
2 hours ago
@Szabolcs You forgot
a /. coef_. a :> coef
:)â xzczd
2 hours ago
1
1
@xzczd You are right. I deleted my comment (it was incorrect).
â Szabolcs
2 hours ago
@xzczd You are right. I deleted my comment (it was incorrect).
â Szabolcs
2 hours ago
2
2
"I searched through different tutorials and documentation articles but haven't been able to find anything yet." Then you haven't yet learned the correct usage of document: i.stack.imgur.com/RVvvv.gif
â xzczd
2 hours ago
"I searched through different tutorials and documentation articles but haven't been able to find anything yet." Then you haven't yet learned the correct usage of document: i.stack.imgur.com/RVvvv.gif
â xzczd
2 hours ago
 |Â
show 1 more comment
2 Answers
2
active
oldest
votes
up vote
5
down vote
accepted
In[5]:= FullForm[_.]
Out[5]= Optional[Blank]
See Optional
and Blank
.
Thanks! I'm still learning some of the basics, I should have thought to use FullForm :)
â Jmeeks29ig
1 hour ago
add a comment |Â
up vote
1
down vote
I'm not sure if this fully answers the question I posted, but after some more searching, I have discovered that it seems like _.
evaluates to Optional
, at least when using ReplaceAll
. An example will be better than words:
_, _. /. _Blank -> g
evaluates to:
g, Optional[g]
I know this is not a full answer, but hopefully it is at least partially helpful.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
In[5]:= FullForm[_.]
Out[5]= Optional[Blank]
See Optional
and Blank
.
Thanks! I'm still learning some of the basics, I should have thought to use FullForm :)
â Jmeeks29ig
1 hour ago
add a comment |Â
up vote
5
down vote
accepted
In[5]:= FullForm[_.]
Out[5]= Optional[Blank]
See Optional
and Blank
.
Thanks! I'm still learning some of the basics, I should have thought to use FullForm :)
â Jmeeks29ig
1 hour ago
add a comment |Â
up vote
5
down vote
accepted
up vote
5
down vote
accepted
In[5]:= FullForm[_.]
Out[5]= Optional[Blank]
See Optional
and Blank
.
In[5]:= FullForm[_.]
Out[5]= Optional[Blank]
See Optional
and Blank
.
answered 1 hour ago
Jason B.
46k382176
46k382176
Thanks! I'm still learning some of the basics, I should have thought to use FullForm :)
â Jmeeks29ig
1 hour ago
add a comment |Â
Thanks! I'm still learning some of the basics, I should have thought to use FullForm :)
â Jmeeks29ig
1 hour ago
Thanks! I'm still learning some of the basics, I should have thought to use FullForm :)
â Jmeeks29ig
1 hour ago
Thanks! I'm still learning some of the basics, I should have thought to use FullForm :)
â Jmeeks29ig
1 hour ago
add a comment |Â
up vote
1
down vote
I'm not sure if this fully answers the question I posted, but after some more searching, I have discovered that it seems like _.
evaluates to Optional
, at least when using ReplaceAll
. An example will be better than words:
_, _. /. _Blank -> g
evaluates to:
g, Optional[g]
I know this is not a full answer, but hopefully it is at least partially helpful.
add a comment |Â
up vote
1
down vote
I'm not sure if this fully answers the question I posted, but after some more searching, I have discovered that it seems like _.
evaluates to Optional
, at least when using ReplaceAll
. An example will be better than words:
_, _. /. _Blank -> g
evaluates to:
g, Optional[g]
I know this is not a full answer, but hopefully it is at least partially helpful.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
I'm not sure if this fully answers the question I posted, but after some more searching, I have discovered that it seems like _.
evaluates to Optional
, at least when using ReplaceAll
. An example will be better than words:
_, _. /. _Blank -> g
evaluates to:
g, Optional[g]
I know this is not a full answer, but hopefully it is at least partially helpful.
I'm not sure if this fully answers the question I posted, but after some more searching, I have discovered that it seems like _.
evaluates to Optional
, at least when using ReplaceAll
. An example will be better than words:
_, _. /. _Blank -> g
evaluates to:
g, Optional[g]
I know this is not a full answer, but hopefully it is at least partially helpful.
answered 1 hour ago
Jmeeks29ig
3066
3066
add a comment |Â
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%2f181826%2fwhat-does-mean-in-patterns%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
I may have found it - it might represent Default, but I have to do some more reading.
â Jmeeks29ig
2 hours ago
That seems to make sense. I am trying to use it in context of pattern matching, using SyntaxInformation, to get the required arguments of some random function, and then insert values into the function in the proper order
â Jmeeks29ig
2 hours ago
@Szabolcs You forgot
a /. coef_. a :> coef
:)â xzczd
2 hours ago
1
@xzczd You are right. I deleted my comment (it was incorrect).
â Szabolcs
2 hours ago
2
"I searched through different tutorials and documentation articles but haven't been able to find anything yet." Then you haven't yet learned the correct usage of document: i.stack.imgur.com/RVvvv.gif
â xzczd
2 hours ago