Group Abstract Group Abstract

Message Boards Message Boards

0
|
4.1K Views
|
1 Reply
|
3 Total Likes
View groups...
Share
Share this post:

Why is this pattern checking true?

POSTED BY: Haolin Li
Posted 6 years ago

If Plus is given a single argument it just returns the argument.

In[1]:= Plus[3]
Out[1]= 3

So if the single argument is a pattern, the unchanged pattern will be returned.

Therefore:

In[2]:= MatchQ[u*w, Times[a_, Plus[b_]]]
Out[2]= True
POSTED BY: Hans Milton
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard